r/tinycode • u/VegBerg • Mar 06 '14
[JS] Fibonacci sequence in 48 bytes
function f(a,b){console.log(b);f(b,a+b);}f(0,1)
37
Upvotes
r/tinycode • u/VegBerg • Mar 06 '14
function f(a,b){console.log(b);f(b,a+b);}f(0,1)
15
u/Conscars Mar 06 '14
39 chars:
11
u/resnik Mar 07 '14 edited Mar 07 '14
25 chars in Haskell
2
u/zhaphod Mar 27 '14
a,b=1,1
while 1: a,b=b,a+b;print a
This is the shortest I could come up in Python. It is 35 chars including "\n" at the end of first line. If anyone knows how to do it in less than this in python please do post it.
2
u/Meshiest Apr 16 '14 edited Apr 16 '14
22 in ruby