Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Knight's Tour Problem in Perl

by Erez (Curate)
on Dec 01, 2008 at 08:49 UTC ( #727038=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Knight's Tour Problem in Perl
in thread Knight's Tour Problem in Perl

I can't see which statement should span to more lines

Seeing as you have

foreach(@moves) { if(my $finalPos = inRange($moved_to, $_))
and
for my $i (0..$N-1)  { $board[$i][$_] = init($i,$_) for (0..$N-1);},
I'd say you do.

Since all "more lines" statements in Perl are conventions, you could just as well mash all into a one long line and claim yourself the winner. Regardless of anything, counting SLOC in Python have an actual meaning, since the syntax is forcing itself on your style. In Perl, every GNU-style coding is just a K&R away from 30% "improvement".

"A core tenant of the greater Perl philosophy is to trust that the developer knows enough to solve the problem" - Jay Shirley, A case for Catalyst.


Comment on Re^3: Knight's Tour Problem in Perl
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (11)
As of 2014-10-24 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (131 votes), past polls