Posts: 928
Joined: Feb 2004
Reputation:
0
Asteron
"Skilled" Python Coder
Posts: 928
i actually wrote a sudoku solver/generator script (not xbmc) months ago and have been thinking about wrapping an xbmc gui around it. i got stuck on the interface. can you think of a pretty way to input the numbers or mark possibilities?
my script uses logic to solve and so can do stuff like provide hints via direct implication... it also supports non-standard sizes and variations like colored squares and diagonal constraints... in generating scripts there is the option of differing symmetries as well (diagonal double-diagonal quarter rotation x-flip xy-flip etc)... but right now it is all text... if you could describe how you want this script to function/look/behave that would be very helpful!
i went kinda nuts over it for a while and so have a lot of raw material to work with but dont know a good way to work it into an xbmc experience.
Posts: 928
Joined: Feb 2004
Reputation:
0
Asteron
"Skilled" Python Coder
Posts: 928
mk... send what you have to me asteron at optonline .dot. net and ill whip something up eventually.
Posts: 928
Joined: Feb 2004
Reputation:
0
Asteron
"Skilled" Python Coder
Posts: 928
did some more work on this and the generator / ui are talking to eachother right now. the generator works great for making some quick sudoku's but for harder ones the optimization routines run too slow so i will likely support grabbing them from the internet as well.
(in optimization i remove as many of the givens as i can and check to see if it is still solvable). i might be able to tweak the logic some more though to get more bang for the buck as generating sudokus is more of an art than a science (i make qualitative decisions as to which square should be fixed as a given and which value i should fix it to. if you are too agressive in the fixing though you can end up with an impossible board and have to backtrack alot.)
i still need to provide an interface for the generator, get hints out of my solver, and maybe provide support for variations like diagonal constraints, disjoint (colored) regions, no boxes...
will probably also number the puzzles so that they can be replayed in the future. lots of ideas...
anyway i will try to get a first version out sometime this week. this thing though really needs a good skin...
-ast
Posts: 3,746
Joined: May 2004
Reputation:
20
Livin
Posting Freak
Posts: 3,746
nice! i've not played this yet but everyone is raving about it. i'll do it once it is on xbmc!
I'm not an expert but I play one at work.
Posts: 928
Joined: Feb 2004
Reputation:
0
Asteron
"Skilled" Python Coder
Posts: 928
hi mrc. just played with your version some and there is definitely some neat stuff in there.
however there is what i would call flaw in the generator in that it can generate puzzles with multiple solutions. it looks like the strategy that the generator uses is that it fully populates the initial grid, permutes it and removes squares. the problem is that if your initial grid contains a rectangle with corners
xy
yx
with none of those as givens then y,x can be switched and there is no way to figure this out logically. most consider this an error.
there are other cases too like
xyz
zxy
yzx
the only way to detect stuff like this though is to try to solve it logically... (do a backtracking solver and attempt all combinations).