Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: SuDoKu solver

by jmcnamara (Monsignor)
on Jul 18, 2005 at 08:06 UTC ( #475666=note: print w/ replies, xml ) Need Help??


in reply to Re: SuDoKu solver
in thread SuDoKu solver


I initially wrote this and it appeared correct according to Test::More::is_deeply(). However, despite the test, it is wrong since the inner array ref is copied rather than recreated (which is probably what you are alluding to above).

my $grid = [([($init) x 9]) x 9]; # ! wrong

So, perhaps somethings like this:

my $grid = [map {[($init) x 9]} 1..9];

I was really addicted to Sudoku puzzles a few weeks ago, but I'm finally getting my life back. :-)

--
John.


Comment on Re^2: SuDoKu solver
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://475666]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (14)
As of 2014-07-11 21:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (235 votes), past polls