pocketlang/test/examples/fib.pk

17 lines
189 B
Plaintext
Raw Normal View History

## Fib test.
res = ''
def fib(n)
a = 0; b = 1
for _ in 0..n
res += to_string(a) + " "
temp = a;
a = b;
b += temp;
end
end
fib(10)
assert(res == '0 1 1 2 3 5 8 13 21 34 ')