Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Golf/Perlish solution to this problem?

by GrandFather (Saint)
on Jan 31, 2008 at 02:59 UTC ( [id://665267]=note: print w/replies, xml ) Need Help??


in reply to Re: Golf/Perlish solution to this problem?
in thread Golf/Perlish solution to this problem?

Except it gives the wrong answer:

Wanted: 8 1 2 7 6 3 4 5 Given: 8 1 7 2 6 3 5 4

Less important - the OP seems to want the array elements in that order rather than just a numeric sequence, but that's trivial to fix by using a slice.


Perl is environmentally friendly - it saves trees

Replies are listed 'Best First'.
Re^3: Golf/Perlish solution to this problem? (1..$n)
by tye (Sage) on Jan 31, 2008 at 06:40 UTC
    Less important - the OP seems to want the array elements in that order rather than just a numeric sequence

    Except that the array elements that the OP wants in that order are: "I have the numbers 1 to n". I doubt s/he cares whether it is his/her original 1..n or just a generated numeric sequence. Just FYI.

    - tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://665267]
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: (2)
As of 2024-04-26 00:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found