pocketlang/test/examples/fib.pk
Thakee Nathees c3041c74a9 fixed: iterator (internal) variables popped twise.
printing stack trace implemented
2021-05-15 00:31:31 +05:30

17 lines
189 B
Plaintext

## 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 ')