Bill Guindon <agorilla / gmail.com> writes:

> On 4/23/05, Christian Neukirchen <chneukirchen / gmail.com> wrote:
>> Douglas Livingstone <rampant / gmail.com> writes:
>> 
>> > On 4/23/05, Lyndon Samson <lyndon.samson / gmail.com> wrote:
>> >> How the following look?
>> >>
>> >> From http://news.bbc.co.uk/1/hi/magazine/4469719.stm
>> >>
>> >
>> > How about a Su Doku writer; the Su Doku solver would just be the unit tests :)
>> 
>> After doing this evil game for an hour or so now, I agree.  I think
>> programming a puzzle maker is harder than solving it automatically.
>> More useful, too. :-)
>> 
>> Evil game, beware.
>
> "He is pleased with the global growth of the game, to which he
> contributed by taking it from a puzzle book he bought in Tokyo in 1997
> and spending six years - "on and off" - writing a computer program
> that produces new Su Dokus on the spot."
>
> If somebody does this in 3 days with Ruby, it's probably gonna make
> this guy cry.

IMO 3 days non-stop coding is pretty realistic (= 1 week of "ordinary"
coding).  The game is not *that* hard to implement.  The problem is
rather making it efficient enough to actually use it... I'd do it in
C, personally.  Ruby doesn't provide a lot of support for 2d-Arrays
and there is not a lot to abstract.

Basically, you create a 9x9 array of numbers that fulfil the solution
(you can probably do that like the n-queens problem), assure there are
no symmetries (exchange numbers if needed) and then drop all
"unneeded" elements.

This will generate puzzles, at least, but I'm not sure if they will be
fun to solve.

> Bill Guindon (aka aGorilla)
-- 
Christian Neukirchen  <chneukirchen / gmail.com>  http://chneukirchen.org