Not a bug report,

Left  arg of GenGRID is maximum number of seconds to run (arg is optional and 
default to 30 secs)
Right arg of GenGRID is the target maximum number of non-zero digits in the 
grid (stopped by timer on the left side)


// generate a random grid and try for the next 60 seconds to reduce it into a 
20 non empty cells.

        Display a←60 GenGRID 20

     ╔═══╤═══╤═══╦═══╤═══╤═══╦═══╤═══╤═══╗
     ║ 4 │   │ 5 ║   │   │ 2 ║   │ 7 │ 1 ║
     ╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
     ║   │   │   ║   │   │   ║   │   │   ║
     ╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
     ║   │   │ 9 ║   │ 4 │   ║   │   │ 6 ║
     ╠═══╪═══╪═══╬═══╪═══╪═══╬═══╪═══╪═══╣
     ║   │   │   ║ 9 │   │   ║ 8 │   │   ║
     ╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
     ║   │ 3 │   ║   │   │ 6 ║   │ 4 │   ║
     ╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
     ║   │   │   ║   │   │   ║ 3 │   │   ║
     ╠═══╪═══╪═══╬═══╪═══╪═══╬═══╪═══╪═══╣
     ║   │ 1 │   ║   │ 6 │   ║   │ 8 │   ║
     ╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
     ║   │ 7 │   ║   │ 2 │ 1 ║   │   │   ║
     ╟───┼───┼───╫───┼───┼───╫───┼───┼───╢
     ║   │   │ 8 ║   │   │   ║   │   │   ║
     ╚═══╧═══╧═══╩═══╧═══╧═══╩═══╧═══╧═══╝

Took 60.37293294 secs (failed at reducing to 20, final was 21)

      a
4 0 5 0 0 2 0 7 1
0 0 0 0 0 0 0 0 0
0 0 9 0 4 0 0 0 6
0 0 0 9 0 0 8 0 0
0 3 0 0 0 6 0 4 0
0 0 0 0 0 0 3 0 0
0 1 0 0 6 0 0 8 0
0 7 0 0 2 1 0 0 0
3 0 8 0 0 0 0 0 0

One of the hardest Sudoku you can dream of (I think) but still solvable.

I got Lucky, because very few initial grids can be reduced as much as that ...

Will post my Sudoku workspace later when I'm satisfied with his behavior and 
speed.


Xtian.

Reply via email to