Sudoku generator
Pixelboy's Sudoku game got me thinking. Now I am wondering about a Sudoku game and especially a generator for the 2600.
Some initial brainstorming:
- Display: Has been discussed multiple times already. Should be able to display the digits (doable), annotations (tricky, 2^9 combinations!) and a cursor. Later...
- RAM: 10 different values per cell (~3.4 bits), should be easily direct accessible, so no fancy compression algorithms. So 2 cells/byte, 40.5 bytes in total. After generating the grid, 1 bit/cell for remembering the given cells, which cannot be changed. During generation...
-
Generation: I had a look into the Java source code of my favorite mobile phone game 5ud0ku (its free!).It basically works like this:
- Fill a diagonal of 3x3 blocks with random numbers (clever idea)
- Let a solver solve this puzzle and take one of the possible solutions. Now we have a valid grid.
- Remove n random digits and check after each removed digit if there is only one solution (solver). If not, either or maybe try a different digit
-
If you where able to remove the required number of digits, fine. If not, restart with 3.1.
So everything looks pretty easy, except for the solver. This has to use some kind of backtracking which is tricky to implement within little memory. So this we be the first thing to analyze.
Sounds a challenge. Great!
Sudoku_v0.1.bin Sudoku_v0.11.bin Sudoku_v0.12.bin Digit3x3.bin
17 Comments
Recommended Comments