Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: fibo's 66 chars

by Anonymous Monk
on May 27, 2009 at 16:06 UTC ( [id://766462]=note: print w/replies, xml ) Need Help??


in reply to fibo's 66 chars

Or, without creating a large list:
@b=(0,1);@b=($b[1],$b[0]+$b[1])for(2..pop);print$b[1];
(and there is no reason to assign $a)

20090727 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips

Replies are listed 'Best First'.
Re^2: fibo's 66 chars
by pepik_knize (Scribe) on May 27, 2009 at 20:59 UTC
    I starting going down that path too, but noticed that it fails for 1.
    $ perl -e'@b=(0,1);@b=($b[1],$b[0]+$b[1])for(2..pop);print$b[1]' 1 1

    Of all the causes that conspire to blind
    Man's erring judgment, and misguide the mind,
    What the weak head with strongest bias rules,
    Is pride, the never-failing vice of fools.
    -- Pope.

Log In?
Username:
Password:

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

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

    No recent polls found