[Request] Sudoku-Script
#1
is any1 out there, who wants to code a sudoku-script?
here is a link which my be helpful:
http://www.setbb.com/phpbb/?mforum=sudoku

thx in advance
Philips TV with Kodi 20.2 with IPTV --- Orbsmart 500 Android 21 alpha/beta as Online-radio/TV in the kitchen
Reply
#2
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.
Reply
#3
Quote: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.
this is funny. i wrote a bit of the gui, but i had no idea for how to randomly generate a grid so i didn't spend any more time on it. maybe we can work something out??



Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#4
i hope you 2 find a way working together! :o

to input the numbers, you can use a 9-digit-pad on the screen. where, for example, if you press "x" the number is "fixed", if you press "y" the number is a "candidate". then we need 9-cell-sqare at the left or right to display the candidates for the sudoku-cell. the numbers in the square should change if you select another sudoku-cell.

buttons we need:
* hint
* solve the sudoku
* reset the sudoku
* undo

i hope you understand my suggestions, because english is not my native language (i´m german). my last english @school was a few years ago Wink
Philips TV with Kodi 20.2 with IPTV --- Orbsmart 500 Android 21 alpha/beta as Online-radio/TV in the kitchen
Reply
#5
if this goes ahead... try to make it remote control friendly be nice to finish watching a movie then relax with some sudoku without unwrapping my controller Smile
Reply
#6
(deanrparry @ jan. 14 2006,12:31 Wrote:if this goes ahead... try to make it remote control friendly be nice to finish watching a movie then relax with some sudoku without unwrapping my controller Smile
great ideas Smile i'll go ahead and modify my code to be less command line oriented. the interfaces i can provide would look something like this

difficulty,board = generator.generateboard(symmetry, optimized, [other options?])
difficulty,board = generator.fromfile(board.cfg)
solvedboard = board.solve()
square,logic_type = board.gethint()

generating boards is relatively easy (after you program a solver) but generating difficult boards is pretty hard. you still might want to have a button to grab a board from an online database like http://www.menneske.no/sudoku/eng/

darkie do you want to try putting the two pieces together or should i?
Reply
#7
Quote:darkie do you want to try putting the two pieces together or should i?
i think it is better if you give it a try. i don't have the script here at this moment, will try to send it a bit later this day to you.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#8
mk... send what you have to me asteron at optonline .dot. net and ill whip something up eventually.
Reply
#9
another gpl'd python sudoku source: http://pythonsudoku.sourceforge.net/
cheers,
luna
Reply
#10
(luna @ jan. 17 2006,15:42 Wrote:another gpl'd python sudoku source: http://pythonsudoku.sourceforge.net/
cheers,
luna
i checked out the code, while his is better commented mine looks somewhat more powerful and a lot more generalizable.

of course logic in this script won't be too important as it will only really be used to give hints and help generate the board more quickly. (a brute force solver requires no logic and will solve every sudoku... allbeit very inefficiently)
it is still kind of hard to generate truely difficult boards... that's why i may still have to hook into that online database.

in anycase i have received darkie's user interface and it is quite usable... though it definitely needs some skinning work i think. if anyone wants to help prettify it that would be great Smile



Reply
#11
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
Reply
#12
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.
Reply
#13
i have published a sudoku script for xbmc.

enjoy,

matz
Reply
#14
well that really takes the pressure off Smile the code looks pretty clean but i havent tried running it yet though. i need to check it out tonight and see if mine will have something to offer...
Reply
#15
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).
Reply

Logout Mark Read Team Forum Stats Members Help
[Request] Sudoku-Script0