Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Golf/Perlish solution to this problem?

by poolpi (Hermit)
on Jan 31, 2008 at 13:31 UTC ( [id://665341]=note: print w/replies, xml ) Need Help??


in reply to Golf/Perlish solution to this problem?

timtowtdi

#!/usr/bin/perl use strict; use warnings; @_ = ( 1 .. 12 ); my @a = map { my @l = (($#_+1)-$_ => $_+1); ($_+1)%2 ? @l : reverse @l; } 0..$#_>>1; print "@a";

Output : 12 1 2 11 10 3 4 9 8 5 6 7

PooLpi

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2024-03-28 11:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found