Soduku (Sudoku) is a Japanese number puzzle game that seems to be taking the world by storm. It’s played on a 9×9 grid. Each square can contain one of the numbers from 1 to 9 (inclusive). A given “problem” has some of the squares filled in, and you are required to fill in the remaining squares, satisfying the constraints:
- Each row has to contain each of the numbers 1 through 9 exactly once.
- Likewise for each column.
- The board can be broken down into 9 3×3 squares (top-left, top-middle, top-right, etc.). Each of these has to contain each of the numbers 1 through 9 exactly once.
Anyway, these puzzles can get pretty tricky. Especially if you don’t know the third rule above — which until recently, I didn’t. Anyway, they’ve sufficient annoyed me now that I had to do something about it; so I wrote
The Langabi.name Soduku Solver
It’s not fancy, but is (in my opinion) very efficient. Enjoy!
Edit: Now available: an explanation of the method my solver uses, and the source code.
Sure! I’m pleased it helped you scam your maths class!
LikeLike
Hmm… I tried with a super hard soduku and the results just came out and here i am cracking my brains to solve it.
😉
LikeLike
200308007
100000005
400759006
809000504
020000083
304080709
902845001
500000002
000102058
LikeLike
plese help me find this i have been tring to find this onefor 2 weeks
LikeLike
Hi Alyssa,
You can just put the problem into my solver, following the link at the top of the page, and it’ll solve it for you. I actually just did so, and got:
2 5 6 3 1 8 4 9 7
1 9 7 6 2 4 8 3 5
4 3 8 7 5 9 2 1 6
8 7 9 2 3 1 5 6 4
6 2 5 4 9 7 1 8 3
3 1 4 5 8 6 7 2 9
9 6 2 8 4 5 3 7 1
5 8 1 9 7 3 6 4 2
7 4 3 1 6 2 9 5 8
LikeLike
I have a little Neopets help site and Neopets created the game Roodoku which is their version of Sudoku. I was hoping to find a free script that I could host myself for my visitors to use to solve the puzzles for them. I found the source code to this, but I’m not a programmer and can’t get it to work. 😦
I’ve seen the online version though, and it’s a blessing!
LikeLike
This puzzle won’t solve because it times out with Firefox. Any suggestions?
–9 –6 4–
–3 — -7-
-2- -8- —
1– 5– –6
-8- 2– -3-
7– — –9
— -4- -8-
-5- — 1–
–6 9– 2–
Thanks,
Bob E
LikeLike
Unfortunately, there seem to be a few puzzles for which my algorithm is not ideal — in technical terms, it needs to do the “bound” part of the branch and bound algorithm sooner. I’ve thought of a few ways to achieve this … and then ran out of energy. Sorry. But it works for nearly all other puzzles.
LikeLike
Why when I enter my numbers and hit solve, does it timeout?
LikeLike
See above comment.
LikeLike
I test this.Great.
217
75******
*84****15
69*****
286419*
****83
****41**6
******91
16****47
LikeLike
Any idea where I can find an efficient java source code for soduko?
LikeLike
Nope, sorry — you could of course re-code mine, but it’s actually not very efficient in its current form, it prunes the branches a little late.
LikeLike
…quick question not related to the sudoku but rather to php, are there any php video tutorials/awesome php books that you may recommend to someone who’s good at programming in java?
LikeLike
Cud u pls give the source code of the Sudoku game & the Sudoku solver in Java
LikeLike
Cud u pls give the source code of the Sudoku game & the Sudoku solver in Java
LikeLike
There’s a link at the bottom of the post to the source code in PHP. Translation to Java should be easy enough!
LikeLike
Hi
I’ve found another run timeout error
on the f_1_1_1 put value=2
then f_8_9_9 put value=2 too
It leads me to error.. would you explain or fix it?
Thanks
LikeLike
Not working as it did before
LikeLike