Posted via CodeCall Mobile
hey all, i was recently reminiscing on some abandoned python projects i mite have another crack at. I decided on the idea of a program to solve the wonderfully addictive sudoko puzzles. At the time, i figured: i solve them by using simple algorithms over and over, so a program should be able to emulate this.
i ran into problems pretty quickly, dnt remember specifically, ill have a better look later.
but basicly i was wondering if anyone knows of or has tried this themselves, especially in python? Im not looking for answers just yet, just confirmation.
thx.![]()
I haveŽdone this before but not in Python (but it would be easy to redone this in Python) however, since I'm not a pro on suduko I didn't know how to solve the most dificult sudukos myself. This resulted in that my program couldn't solve the most dificulty ones either. I had a book with sudoko puzzles and my program could complete the diffiluty 1, 2 and 3 but not number 4.
At that point the fastest solution is recursive brute-force. But yeah, Python can easily deal with sudokus, and even write a pretty gui in no time.
Hm do you think a backtracking algorithm would work? It wouldn't be a brute force algorithm. I don't know much about sudoku but wouldn't you try to print a number if the number is valid, and then move to the next square. If you get to the end of the row, without placing a number, then move back and try a new number?
I haven't tried it but it wouldn't be that hard once you get the algorithm. Any language can do it.
this should probably go in a new thread, but what would u suggest for "making a pretty gui in no time"?
making a cute window with Tkinter and a Canvas![]()
There's actually a book on the market for how to program a sudoku solver in VB. You could easily translate the algorithms into python.
Posted via CodeCall Mobile
personally, i would rather figure it out myself, then maybe look at other peoples ways.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks