B4J Tutorial B4J Sudoku

Just for the fun of it....

Button Create = uses class dlx_generator to create a new puzzle
Button New Puzzle = use a variant of 1 of the 742 puzzles embedded in the code (randomly swapping columns/rows to create more than the 742 puzzles)
Button Solve = obviously solving the current puzzle.

It uses the Dancing Links algorithm by Donald Knuth to solve the puzzles (and also to create puzzles when clicking on button Create).

1.png
 

Attachments

  • b4jSudoku.zip
    34 KB · Views: 330
Last edited:

William Lancee

Well-Known Member
Licensed User
Longtime User
A master class in the use of inline Java in B4X!

Three years ago I wrote an Sudoku app for my phone (B4A) to entertain myself on my weekly visits to an aging relative.
It could also solve the puzzles, but your app computes solutions at least 1000 x faster.
 

Johan Schoeman

Expert
Licensed User
Longtime User
A "playable" version is here

 
Top