Generating A Sudoku Board
Posted 21 December 2012 - 06:01 PM
So my first question is, does anyone have an algorithm, and my second is if there is already a lua sudoku board generator that i could use without having to reinvent the wheel.
Posted 22 December 2012 - 10:09 AM
1. You already have a solved sudoku
->delete some numbers (22 to 36 numbers should stay)
2. You want to create a random sudoku
->1.: you generate random numbers in a random place and try to solve it with backtracking until you can't solve it -> then you take the last solveable solution
->2.: you spread nine ones, nine twos, nine threes,... and try to solve with backtracking
->3.: you take a "normal" sudoku and change the lines or reflect them
source: Wikipedia (see Creating new sudokus)
Edited by Casimo, 01 January 2013 - 05:11 PM.
Please link to english sites :)
- MicroPro likes this
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users