Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Subroutine overhead in Perl

by Anonymous Monk
on Nov 06, 2007 at 18:44 UTC ( [id://649316]=note: print w/replies, xml ) Need Help??


in reply to Re: Subroutine overhead in Perl
in thread Subroutine overhead in Perl

i'm not a sudoku player, but i thought that the objective was...
...each column, each row, and each of the nine 3×3 boxes (also called blocks or regions) contains the digits from 1 to 9, only one time each (that is, exclusively).
(from wikipedia sudoku article, emphasis added).

since the second row ("-,2,2,-,9,-,7,1,5") contains 2 twice, is your test input correct?

Replies are listed 'Best First'.
Re^3: Subroutine overhead in Perl
by strat (Canon) on Nov 07, 2007 at 07:26 UTC

    A very special testcase is the following sudoku:

    9-6-7-4-3 ---4--2-- -7--23-1- 5-----1-- -4-2-8-6- --3-----5 -3-7---5- --7--5--- 4-5-1-7-8
    which has two solutions:
    926571483 351486279 874923516 582367194 149258367 763194825 238749651 617835942 495612738
    and
    926571483 351486279 874923516 582367194 149258367 763149825 238794651 617835942 495612738

    Best regards,
    perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"

      AFAIK, a "good" SuDoKu puzzle should have a unique solution.

      Flavio
      perl -ple'$_=reverse' <<<ti.xittelop@oivalf

      Io ho capito... ma tu che hai detto?

        That's true; but if you are beware of such strange user input, it's easier to write tests and make sure that such strange user input is also handled correctly...

        Best regards,
        perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-20 03:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found