2024-05-11 10:05:22 -05:00
|
|
|
|
2024-05-11 15:22:08 -05:00
|
|
|
main := fn(): int {
|
2024-05-11 10:05:22 -05:00
|
|
|
return fib(10);
|
|
|
|
}
|
|
|
|
|
2024-05-11 15:22:08 -05:00
|
|
|
fib := fn(x: int): int {
|
2024-05-11 10:05:22 -05:00
|
|
|
if x <= 2 {
|
|
|
|
return 1;
|
2024-05-11 11:16:27 -05:00
|
|
|
} else {
|
|
|
|
return fib(x - 1) + fib(x - 2);
|
2024-05-11 10:05:22 -05:00
|
|
|
}
|
|
|
|
}
|