Files
monkey/examples/fib.monkey
Chuck Smith fc6ceee02c
Some checks failed
Build / build (push) Failing after 5m21s
Publish Image / publish (push) Failing after 32s
Test / build (push) Failing after 5m8s
restructure project
2024-03-28 16:20:09 -04:00

14 lines
149 B
Plaintext

fib := fn(x) {
if (x < 2) {
return x
}
return fib(x-1) + fib(x-2)
}
N := 35
if (len(args()) == 1) {
N = int(args()[0])
}
print(fib(N))