Code Monkey home page Code Monkey logo

numberplace-generator's Introduction

numberplace-generator

The numberplace-generator provides a function to generate a game of numberplace (Sudoku).

How to use

Install it.

npm install @ysk8hori/numberplace-generator

Generate a number place game and its answers by doing the following

import { generateGame } from '@ysk8hori/numberplace-generator';
// Generate standard 9x9 size number place game.
const [puzzle, solved] = generateGame({ width: 3, height: 3 });

console.log(pazzle.toString());
/*
9, , , , , ,4, , 
6, , ,4,9,2,3,5, 
2, ,4, ,6,3, ,1,9
 , , , , , ,5,6,2
5, , , , , , ,3, 
 ,3, ,9, , ,7, ,1
7, , , ,5,6, ,9, 
 ,2, ,3, , ,6,7, 
3, , ,7, ,1,2,4, 
*/

console.log(solved.toString());
/*
9,5,3,8,1,7,4,2,6
6,8,1,4,9,2,3,5,7
2,7,4,5,6,3,8,1,9
8,9,7,1,3,4,5,6,2
5,1,2,6,7,8,9,3,4
4,3,6,9,2,5,7,8,1
7,4,8,2,5,6,1,9,3
1,2,5,3,4,9,6,7,8
3,6,9,7,8,1,2,4,5
*/

The block size of argument is refers to the size of a 3x3 square area for a game that is 9x9 overall. The argument must be an object of { width: number, height: number }. The length of one side of the game (width multiplied by height) must be 3 or higher, and less than 9. If a larger size is specified, it will take longer to generate the game.

numberplace-generator's People

Contributors

renovate[bot] avatar ysk8hori avatar renovate-bot avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

numberplace-generator's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/delta-tsg.yml
  • actions/checkout v4.1.7
  • ysk8hori/delta-typescript-graph-action v1.0.3
.github/workflows/pre-workflow.yml
  • actions/checkout v4
  • actions/setup-node v4
.github/workflows/release.yml
  • actions/checkout v4
  • actions/setup-node v4
npm
package.json
  • reflect-metadata ^0.2.0
  • tsyringe ^4.6.0
  • uuid ^10.0.0
  • @types/node 20.14.12
  • @types/uuid 10.0.0
  • @typescript-eslint/eslint-plugin 7.17.0
  • @typescript-eslint/parser 7.17.0
  • commitizen 4.3.0
  • cz-conventional-changelog 3.3.0
  • eslint 8.57.0
  • eslint-config-prettier 9.1.0
  • prettier 3.3.3
  • semantic-release 24.0.0
  • tsc-alias 1.8.10
  • tsconfig-paths 4.2.0
  • typescript 5.5.4
  • vitest 2.0.4

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.