Paint-by-numbers solver

T

Tim L

This might interest some members of this group
http://www.lund-tvam.demon.co.uk/it/edel.rb. 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_by_numbers.

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_edel-e.html - 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,207
Messages
2,571,078
Members
47,682
Latest member
TrudiConna

Latest Threads

Top