[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Paint-by-numbers solver

Tim L

6/29/2006 8:22:00 AM

This might interest some members of this group
http://www.lund-tvam.demon.co.uk/.... It's a solver for the puzzle
known in Japanese as Edel, in English as 'Paint-by-numbers' - see
http://en.wikipedia.org/wiki/Paint_....

It's probably not complete, because it doesn't handle the 'last resort'
strategy of 'what-ifs' - see the wikipedia link above. However even the
'hard' puzzle (#9) I tested it on from this link -
http://www.puzzle.jp/letsplay/play_e... - didn't seem to need it. If
there are puzzles that do need this, then extending the code to handle this
is perfectly do-able - I did something similar in a VBA function I wrote to
solve Sudoku problems, where this technique seems more important.

I wrote this as a challenge, and a way of getting the hang of Ruby, which
seems a pretty good tool for it. I'd be delighted if any real Ruby experts
could look at the code and tell me how it could be done more stylishly, or
efficiently. There are probably also better strategies / algorithms for
solving this, but that's more maths than Ruby.

Any thoughts, help on developing an in-Ruby GUI? I've read through the Ruby
TK chapter of the Pickaxe book, but that's about it. The VBA Sudoku solver
I mentioned impresses because Excel is in itself such a good user interface.
I'd love to be able to impress people with something similar in Ruby, but I
probably won't have time before I start a proper job.

Tim L