Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Golfing a fibonacci number generator

by sh1tn (Priest)
on Nov 04, 2006 at 16:07 UTC ( [id://582249]=note: print w/replies, xml ) Need Help??


in reply to Re: Golfing a fibonacci number generator
in thread Golfing a fibonacci number generator

Yes, that's right and in realtion to this I posted an year ago the same one-liner but 27 chars long (the shortest one in the world):
print$}+=$.=$}-$.||1while.1
Re: Fibonacci numbers (again)


Replies are listed 'Best First'.
Re^3: Golfing a fibonacci number generator
by cLive ;-) (Prior) on Nov 04, 2006 at 18:35 UTC
    Doesn't work - at least not for me. My best stab is 39 chars (which I'm sure can be improved):
    ($x,$y)=($y,$x+$y),print$y for$x++..19
      Yes, it works just fine (blame only yourself for your errors):
      perl -e 'print$}+=$.=$}-$.||1while.1' 1235813213455891442333776109871597258441816765109461771128657463687... +...... # and so on...


        You're missing a 1 at the beginning.

Log In?
Username:
Password:

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

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

    No recent polls found