Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Make a solver for Su Doku in freebasic.
#31
the problem with that puzzle is that the cell two below the 5 has no answer, because all the numbers are visible to it either by col, or row. A fairly trivial problem, but it caused my program to fail, because i wasn't checking if cells have no solution, only looking at what solutions a cell does have, if you get my meaning.

I'm pretty sure i've got my solving engine done now, i'm just struggling to get gfxlib to work correctly on lin/dos so i can do a nice graphical version.
EVEN MEN OF STEEL RUST.
[Image: chav.gif]
Reply
#32
Yeah ok, but I still don't see it.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#33
if you count the top left as (0, 0), then the cell at (1, 6) cannot contain any number. This is because 1, 2, 3, 4 and 5 are visible in column 1, and 6, 7, 8, and 9 are visible in row 6. Therefore there are no numbers left that are valid in that square.
EVEN MEN OF STEEL RUST.
[Image: chav.gif]
Reply
#34
I see it. 8)
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#35
I just updated to what i believe will be my final code (unless someone finds a fault)

I also have a beta of my graphical interface version, it works fine, but the interface just could be better.

http://www.streetcds.co.uk/sudoku_v0.4.zip

EDIT : board in was sometimes being returned changed, added backup

also found this sudoku

100200300
000000000
002004090
300100200
000000000
094002000
200300100
000000000
000090004

takes 19 seconds (very slow) to prove unsolvable
EVEN MEN OF STEEL RUST.
[Image: chav.gif]
Reply
#36
That is cool.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#37
PS: I added your name (yetifoot) in the first post... :-)
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#38
thanks.
EVEN MEN OF STEEL RUST.
[Image: chav.gif]
Reply
#39
I am going to make a GUI for it too. I found this to be very useful, especially for Beckii, who enters competitions, and Sudoku happens to be one of these puzzles.

>anarky
Screwing with your reality since 1998.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)