Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Idea for Ruby Quiz - Su Doku solver

Reply
Thread Tools

Idea for Ruby Quiz - Su Doku solver

 
 
Lyndon Samson
Guest
Posts: n/a
 
      04-23-2005
How the following look?

From http://news.bbc.co.uk/1/hi/magazine/4469719.stm

For those who don't know, it's a puzzle found in newspapers, books and
online. A simple-looking grid of nine rows by nine, split into nine
boxes, each containing nine squares, it looks like just another
numbers game.

But, say Su Doku experts, the difference is it can be played using
logic alone, so maths phobics read on.

To be pure Su Doku each of the unique puzzles - which come in varying
levels of difficulty - must have only one solution. The aim? To fill
in the grid so that every row, every column, and every box contains
the digits one to nine


--
Into RFID? www.rfidnewsupdate.com Simple, fast, news.



 
Reply With Quote
 
 
 
 
Douglas Livingstone
Guest
Posts: n/a
 
      04-23-2005
On 4/23/05, Lyndon Samson <> 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

Douglas



 
Reply With Quote
 
 
 
 
Bill Guindon
Guest
Posts: n/a
 
      04-23-2005
On 4/23/05, Christian Neukirchen <> wrote:
> Douglas Livingstone <> writes:
>
> > On 4/23/05, Lyndon Samson <> 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.

> > Douglas

> --
> Christian Neukirchen <> http://chneukirchen.org
>
>


--
Bill Guindon (aka aGorilla)



 
Reply With Quote
 
David A. Black
Guest
Posts: n/a
 
      04-23-2005
Hi --

On Sat, 23 Apr 2005, Bill Guindon wrote:

> "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.


There's no crying in Ruby!!


David

--
David A. Black



 
Reply With Quote
 
Florian Groß
Guest
Posts: n/a
 
      04-23-2005
Christian Neukirchen wrote:

> Ruby doesn't provide a lot of support for 2d-Arrays
> and there is not a lot to abstract.


What about NArray?



 
Reply With Quote
 
Vance A Heron
Guest
Posts: n/a
 
      04-24-2005
I wrote a solver in Ruby in about 2 hrs - not pretty, but it
works. As mentioned by Christian, I used the same approach as
the 8-queens problem. I'm using the int[][] notation...

Solving runs fast enough in ruby - no need for 'C'. I find
it interesting to note the number of times you need to backtrack
in the puzzles rated "fiendish" difficulty. (In some, there
no backtracking at all!).

I'll think about a generator tomorrow - but it seems that much
of the "difficulty" is determined by *which* numbers you remove
from the answer. I haven't spent much time playing by
hand, but I'm figuring the difficulty from a computer stantpoint
is directly related to the bactracking. Looking at it, one might
be able to start recognizing patterns and make choices that require
less backtracking.

Vance


On Sun, 2005-04-24 at 02:34 +0900, Christian Neukirchen wrote:
> Florian Groß <> writes:
>
> > Christian Neukirchen wrote:
> >
> >> Ruby doesn't provide a lot of support for 2d-Arrays
> >> and there is not a lot to abstract.

> >
> > What about NArray?

>
> It exists, but where is the advantage over int[][]?
>
> Anyway, I quickly wrote a Su Doku solver in gprolog, you can look at
> it here:
>
> http://rafb.net/paste/results/1ogo8j31.html
>
> There are languages that have even less support for 2d-arrays.
>
> Happy hacking,




 
Reply With Quote
 
James Edward Gray II
Guest
Posts: n/a
 
      04-24-2005
On Apr 24, 2005, at 4:01 AM, Vance A Heron wrote:

> I wrote a solver in Ruby in about 2 hrs - not pretty, but it
> works. As mentioned by Christian, I used the same approach as
> the 8-queens problem. I'm using the int[][] notation...


This sounds like a fine difficultly for a Ruby Quiz problem then.
Anyone willing to write up the quiz and send it to
? I will sure run it.

James Edward Gray II



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[QUIZ] Crossword Solver (#132) Ruby Quiz Ruby 7 04-24-2008 08:47 AM
2007/12/01 new Vero.VISI.v15.0., Cadence.OrCad.v16.0,Dassault.Systemes.Catia.P3.V5R18.DOKU, Actel.Designer.v8.1, DASYLab.v10.0,other new programs ola9@mail.gr NZ Computing 0 12-01-2007 01:28 PM
where i can get the cisco doku CD ? Fred Merz Cisco 1 07-03-2006 03:19 PM
[QUIZ] Sodoku Solver (#43) Ruby Quiz Ruby 39 08-23-2005 08:17 PM
[SOLUTION] Ruby Quiz #15 Animal Quiz David Tran Ruby 9 01-21-2005 02:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57