Idea for Ruby Quiz - Su Doku solver

Discussion in 'Ruby' started by Lyndon Samson, Apr 23, 2005.

  1. 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.
    Lyndon Samson, Apr 23, 2005
    #1
    1. Advertising

  2. Douglas Livingstone, Apr 23, 2005
    #2
    1. Advertising

  3. Lyndon Samson

    Bill Guindon Guest

    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)
    Bill Guindon, Apr 23, 2005
    #3
  4. 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
    David A. Black, Apr 23, 2005
    #4
  5. 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?
    Florian Groß, Apr 23, 2005
    #5
  6. 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,
    Vance A Heron, Apr 24, 2005
    #6
  7. 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
    James Edward Gray II, Apr 24, 2005
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hal Fulton

    Ruby (quiz?) simulation idea

    Hal Fulton, Dec 7, 2004, in forum: Ruby
    Replies:
    8
    Views:
    146
    James Edward Gray II
    Dec 7, 2004
  2. Ruby Quiz

    [QUIZ] Sodoku Solver (#43)

    Ruby Quiz, Aug 19, 2005, in forum: Ruby
    Replies:
    39
    Views:
    343
    Josef 'Jupp' SCHUGT
    Aug 25, 2005
  3. Lyndon Samson

    Ruby Quiz Idea

    Lyndon Samson, Oct 19, 2005, in forum: Ruby
    Replies:
    6
    Views:
    93
    David Balmain
    Oct 21, 2005
  4. Kev Jackson

    Ruby quiz idea

    Kev Jackson, Jan 19, 2006, in forum: Ruby
    Replies:
    3
    Views:
    77
    James Edward Gray II
    Jan 19, 2006
  5. Ruby Quiz

    [QUIZ] Crossword Solver (#132)

    Ruby Quiz, Jul 27, 2007, in forum: Ruby
    Replies:
    7
    Views:
    122
    Andreas Launila
    Apr 24, 2008
Loading...

Share This Page