https://github.com/denissdubinin/javascript-sudoku
Javascript Sudoku
https://github.com/denissdubinin/javascript-sudoku
javascript jquery-plugin jquery-plugins sudoku sudoku-generator sudoku-puzzle
Last synced: about 1 year ago
JSON representation
Javascript Sudoku
- Host: GitHub
- URL: https://github.com/denissdubinin/javascript-sudoku
- Owner: denissdubinin
- License: mit
- Created: 2018-09-07T13:43:16.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-27T07:45:40.000Z (over 7 years ago)
- Last Synced: 2025-05-07T21:53:59.091Z (about 1 year ago)
- Topics: javascript, jquery-plugin, jquery-plugins, sudoku, sudoku-generator, sudoku-puzzle
- Language: JavaScript
- Homepage: https://denissdubinin.github.io/javascript-sudoku/
- Size: 59.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Javascript Sudoku
[](https://github.com/denissdubinin/javascript-sudoku)
Javascript plugin that generates random sudoku grid.

## Demo
https://denissdubinin.github.io/javascript-sudoku/
## Installation
### CDN
1. Add a sudoku script to your page:
```html
```
2. Add a sudoku stylesheet to your page:
```html
```
### Local files
1. Add a sudoku script to your page:
```html
```
2. Add a sudoku stylesheet to your page:
```html
```
## Usage
1. Create `div` element on your page:
```html
```
2. Initialise Sudoku plugin:
```javascript
$(element).Sudoku();
```
3. Custom control buttons
You can use custom buttons for sudoku. To disable default buttons, set options `useCustomButtons` to `true`.
For custom buttons use `ID` selector:
* `start-sudoku` for start button
* `r-sudoku` for reset button
* `gn-sudoku` for generate button
Example:
```html
```
# Example
```javascript
$(element).Sudoku({
dropTimerOnReset: true,
markWrongCellsOnFly: false,
useTimer: true,
timerOnly: true,
});
```
## Options
`squareSize`
Size of small squre. Default `3`
`dropTimerOnReset`
Reset timer on sudoku reset. Default `true`
`markWrongCellsOnFly`: false,
Mark cell with red if it has wrong value right after number is entered. Default `false`
`markWrongCellsOnFinish`
Mark cell with wrong value with red when all cells are filled. Default `true`
`useTimer`
Enable timer. Default `true`
`timerOnly`
Game can be started only with activated timer. Works only with `options.useTimer === true`. Default `true`
`useCustomButtons`
If you want to use own control buttons, enable this options. Default `false`
`sudokuMixIterations`
Iterations count for mixing random rows and columns between themselfs The larger number, the more mixed sudoku becomes and the more time script initialisation takes. Default `500`
## Dependencies
jQuery 1.7
## License
Copyright © 2018 Deniss Dubinin
Licensed under the MIT license.