Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

RE (tilly) 1: Fibonnaci

by tilly (Archbishop)
on Oct 03, 2000 at 03:20 UTC ( [id://35011]=note: print w/replies, xml ) Need Help??


in reply to Reaped: Fibonnaci

Without an array and starting from 0:
$a=$b=1;{$b-=$a+=$b*=-1;print$a,$/;999999>$a&&redo}

Replies are listed 'Best First'.
RE: RE (tilly) 1: Fibonnaci
by Adam (Vicar) on Oct 03, 2000 at 03:49 UTC
    Wow! Ok, I'm impressed.
      Thanks, but I stopped golfing way too soon:
      $a=1;print$a-=$b+=$a*=-1,$/while$a<10**6
        Yup, you did:
        $a=1;print$a-=$b+=$a*=-1,$/for 0..31
        (After all 1346269 is an arbitrary stopping place.)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (7)
As of 2024-03-29 11:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found