Sudöku - sudoku solver

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Sudöku - sudoku solver

Post by T-Bone »

I was bored. Enjoy :neko:

Click on a box and press a number to enter them. Then press space to solve, and space again to clear.
Attachments
sudoku.love
:ppPPpPPpPP
(156.06 KiB) Downloaded 153 times
Last edited by T-Bone on Thu Aug 11, 2011 5:01 pm, edited 1 time in total.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Sudöku - sudoku solver

Post by Roland_Yonaba »

T-Bone wrote:I was bored.
You do have kind of weird ways to divert... :crazy:

Seems my graphic card have a point with OpenGL..
Error: Cannot create Framebuffers...

Just curious..What kind of algorithm did you use for solving ?
I am expecting backtracking... :ultrahappy:
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Sudöku - sudoku solver

Post by T-Bone »

Oh yeah, I use a framebuffer to draw the boxes since they're the same every frame. I can make a non framebuffer version for you.

I don't really know the name of sudoku algorithms but it's really a brute force method of trying every possible combination until it finds one that works :neko:

EDIT: Try this! It doesn't use a framebuffer until you press f, so just don't do that.
Last edited by T-Bone on Thu Aug 11, 2011 5:01 pm, edited 1 time in total.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Sudöku - sudoku solver

Post by Roland_Yonaba »

Wow.. Solving process is quite fast. Nice job!
Guess you might be interested in WxLuaSudoku, by John Labenski.
it uses WxLua, a WxWidgets binding for Lua.
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Sudöku - sudoku solver

Post by T-Bone »

Just noticed that if you give it a sudoku that's unsolvable, it kind of looses it and stops responding, using lots of CPU (but doesn't seem to leak memory). I probably did something wrong somewhere :P Might fix sometime. Maybe :neko:
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Sudöku - sudoku solver

Post by Robin »

T-Bone wrote:Just noticed that if you give it a sudoku that's unsolvable, it kind of looses it and stops responding, using lots of CPU (but doesn't seem to leak memory). I probably did something wrong somewhere :P Might fix sometime. Maybe :neko:
Seems like the same problem RPG had with his lQuery tic tac toe thingy: it keeps looking for the next possibility, but if there is none, it just keeps looking in an infinite loop.
Help us help you: attach a .love.
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Sudöku - sudoku solver

Post by T-Bone »

Robin wrote:
T-Bone wrote:Just noticed that if you give it a sudoku that's unsolvable, it kind of looses it and stops responding, using lots of CPU (but doesn't seem to leak memory). I probably did something wrong somewhere :P Might fix sometime. Maybe :neko:
Seems like the same problem RPG had with his lQuery tic tac toe thingy: it keeps looking for the next possibility, but if there is none, it just keeps looking in an infinite loop.
Yeah. I tried to avoid that, I've probably misplaced a "return false" or something :neko:
Post Reply

Who is online

Users browsing this forum: No registered users and 42 guests