mirror of https://git.sr.ht/~garritfra/sabre
Garrit Franke
3 years ago
4 changed files with 39 additions and 13 deletions
@ -1,12 +1,12 @@
|
||||
main :: () { |
||||
return fib(3) + fib() |
||||
let num = 10 |
||||
return fib(num) |
||||
} |
||||
|
||||
fib :: (n) { |
||||
if n { |
||||
let x = 1 + n |
||||
return x |
||||
if 1 >= n { |
||||
return n |
||||
} |
||||
|
||||
return 1 |
||||
return fib(n-1) + fib(n-2) |
||||
} |
Loading…
Reference in new issue