 |
Speedoku: Technical stuff
|
 |
Some people may have noticed that I took a little shortcut with the Help
section. That one is actually not part of the applet. In iOS you have highly
capable web view components, but the web page rendering in Java
leaves something to be desired, so I put the whole text in an invisible HTML
<div> that shows up when you click on Help and vanishes again when the back button
is clicked.
Neither this version nor the original app creates any puzzles from scratch. Rather,
I keep a library of pre-approved sudoku boards that felt "just right" in
terms of difficulty, and which are then randomly permutated to generate an almost
endless supply of actual boards for the user. I figured I can always change this
later on, if some purists complain.
The bot "AI" for the practice mode isn't much to brag about either. In short,
the bots randomly pick an empty square on the board (blue). They then check the
combined area of the row, column and 3x3 group it belongs to (red). If there is
just one digit missing, then that has to go into this square. In our case it
should be a 4.
For the relatively simple sudoku puzzles that this game contains, such an
algorithm is good enough to give the bots a fair chance without having to resort
to cheating.
|