Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Subroutine overhead in Perl

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


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

Your grid has no solution since 2 appear twice in the second row.
-,-,4,-,-,2,-,-,3 -,2,2,-,9,-,7,1,5 <---- 7,-,-,3,1,-,4,-,- -,1,-,-,-,-,2,-,9 -,4,-,2,7,-,-,-,6 2,8,-,5,-,-,-,-,- 5,-,-,-,-,3,6,-,4 -,3,1,-,-,8,-,-,2 4,6,-,-,5,-,-,3,1

Sorry, the program is not very friendly about errors. I kinda try to get the algorithm right then work on the error checking...

Replies are listed 'Best First'.
Re^3: Subroutine overhead in Perl
by dragonchild (Archbishop) on Nov 06, 2007 at 19:46 UTC
    Cool. I have a functioning run now. It ran in 0.012s on my Macbook Pro on that test input. What input did you use?

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

      Here are "easiest" and "hardest" of the final test files plus one really evil bugger one of developers found. Test time are on a Dell Optiplex 745:

      Processor: Core 2
      Speed: 1.86 GHz
      Level 1 cache: 32KB
      Level II cache: 256M
      Main RAM: 4G

      easy -,-,-,-,-,-,5,-,- 7,6,-,5,1,-,3,-,- 8,5,-,-,7,-,-,1,4 -,-,-,-,-,1,-,7,3 3,1,7,9,-,5,8,4,6 4,9,-,7,-,-,-,-,- 9,7,-,-,3,-,-,2,5 -,-,6,-,9,2,-,8,1 -,-,4,-,-,-,-,-,- real 0m0.038s user 0m0.027s sys 0m0.006s hard -,-,-,-,-,-,-,-,- -,-,-,-,-,3,-,8,5 -,-,1,-,2,-,-,-,- -,-,-,5,-,7,-,-,- -,-,4,-,-,-,1,-,- -,9,-,-,-,-,-,-,- 5,-,-,-,-,-,-,7,3 -,-,2,-,1,-,-,-,- -,-,-,-,4,-,-,-,9 real 0m5.324s user 0m5.311s sys 0m0.007s evil -,-,5,-,-,-,-,4,- -,-,-,8,-,-,-,-,6 3,-,2,-,-,1,-,-,- -,-,-,-,-,4,-,2,- -,-,9,-,-,-,5,-,- -,6,-,3,-,-,-,-,- -,-,-,-,-,-,-,-,3 -,-,-,-,-,5,-,-,- -,1,-,-,-,-,6,8,- real 0m27.371s user 0m27.207s sys 0m0.020s

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (8)
As of 2024-04-23 08:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found