in reply to Fibonacci golf with one state variable
Not the shortest, but how do you like this? It prints the whole sequence upt to the first number needing an exponent.
perl -e '$_||="0$/1";s;(.+)$/(.+)$;"$1$/$2$/".($1+$2);ge while!/e/;pri +nt'
BTW: What's "say"? My perdoc doesn't tell me anything about it.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Fibonacci golf with one state variable
by Lawliet (Curate) on Oct 05, 2008 at 22:32 UTC | |
Re^2: Fibonacci golf with one state variable
by ikegami (Patriarch) on Oct 05, 2008 at 23:01 UTC |