2023-12-02 03:54:25 +00:00
|
|
|
fib = <fn int -> int> |i| {
|
2023-10-13 19:20:20 +00:00
|
|
|
if i <= 1 {
|
2023-10-09 19:54:47 +00:00
|
|
|
1
|
|
|
|
} else {
|
2023-10-13 19:20:20 +00:00
|
|
|
(fib i - 1) + (fib i - 2)
|
2023-10-09 19:54:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-10-13 19:20:20 +00:00
|
|
|
(fib 5)
|