flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
ATV
World is full of Sudoku people, so here is Mini Sudoku.
I don't like solve by myself, so lets give computer do the hard job. If you want see really small Sudoku solver check Hugi Size Coding Compo 25 http://www.hugi.scene.org/compo ToDo: - sudoku generator - save best times into file edit1: Madis, thanks for info, it's fixed now edit2: Added enable/disable undo, drag/drop data file edit3: Ask to save after changes, few bugs fixed edit4: menu, undo/redo, show used time, arrow keys, bigger number font edit5: is solvable test,copy2clipboard,filename in caption,initial digits read-only edit6: load multi entry sudoku file,restart,output in 81/9x9/9x9grid format
Last edited by ATV on 08 Sep 2006, 11:59; edited 6 times in total |
|||||||||||
![]() |
|
Madis731
That is my kind of program
![]() The only problem is that your stack is floating away and its crashing when returning from your code to user32.dll You do NOT want to modify EBX in your dialog code - I've made this kind of mistakes a lot. Replace: Code: line 38: push ebx esi edi cmp [msg],WM_INITDIALOG ;Then replace line 220: pop edi esi ebx ret Its always a good idea to preserve registers - I think you have WinXP, that is why it works. PS. http://www.hugi.scene.org/compo <= I see Estonia listed there, also ![]() |
|||
![]() |
|
ATV
locodelassembly, This is my first win program (and few visual basic progs over 10 years ago)
I don't know anything about windows programming, DOS is my thing. My old P166 has some startup problems (hd or motherboard problem), so I start to try win programming with my HP laptop with WinXP/SP2 Home. And Sudoku seems to be easy to start with. |
|||
![]() |
|
ATV
Above attachment updated
New features in v0.04 - menu - undo/redo rewritten - show used time - use arrow keys - bigger number font |
|||
![]() |
|
rugxulo
|
|||
![]() |
|
ATV
Above attachment updated
New features in v0.05 - try automatically detect empty char - is solvable test - copy current numbers to clipboard - filename in caption - initial digits is read-only thanks to Alex Torba |
|||
![]() |
|
ATV
Above attachment updated
New features in v0.06 - load multi entry sudoku file - cell count/81 - restart - output in 81/9x9/9x9grid format |
|||
![]() |
|
rugxulo
Here's another similar thread: Smallest sudoku solver
|
|||
![]() |
|
0.1
Hello ATV!
Cool stuff really! Just a little favor from you plz. Can you post the logic of your SuDoKu solver in plain English here? plz. thx. PS: Well not the whole program ![]() |
|||
![]() |
|
ATV
0.1, plain English, huh, then Im wrong person to answer, my English is very bad.
It's just brute-force solver using recursive call (it keep previous values/empty position in stack). Code: Find empty position, if not found puzzle is solved then set it '1' and check if other '1' found in same row or column or box if same value not found, find next empty position and so on else try '2' then '3' ... if '9' can't be set, go back to previous empty position (note: it's not empty any more) and set it +1 then check, and so on If you are new with recursive calls try find some Fibonacci, factorial, GCD, sort, dir-search and Towers_Of_Hanoi algorithms, they are often written with recursive calls http://en.wikipedia.org/wiki/Recursion_%28computer_science%29 |
|||
![]() |
|
Madis731
I think it was nicely explained
![]() ![]() |
|||
![]() |
|
0.1
Thx a lot ATV!
I must confess I'm still pretty confused ![]() But your explanation is very valuable to me! _________________ Code: o__=- ) (\ /\ |
|||
![]() |
|
ATV
Madis731, brute-force works very well, because it will always find solution. More human like solvers usually gives "running out of algorithms" errors with really difficult sudoku. It's really difficult to write solver without brute-force. And those solvers are very big, no chance in Hugi Size Coding compo. Look from sudoku boards thinks like "X-Wing", "XY-Wing", "Forcing Chain", "Swordfish". Sometimes brute-force is little slow because it don't see easy numbers. Like last row "12345678x" that "x" will be filled in last with try "1" to "9", human just put "9" there without big thinking and looks second easy place.
|
|||
![]() |
|
tthsqe
Your program is really great, but the solver is realy slow.....
I have got a solver (working on a generator) that is VERY fast.... would you mind putting it in your program? |
|||
![]() |
|
ManOfSteel
ATV's last post is the one right above yours. And it's 2 years and a half old.
|
|||
![]() |
|
tthsqe
so this project has been abandoned?
|
|||
![]() |
|
ManOfSteel
No idea. Probably. Ask ATV if you ever find a way to contact him.
But feel free to continue where he left. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.