0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 09:14:46 +01:00
posthog/hogvm/__tests__/recursion.hog

20 lines
354 B
Plaintext
Raw Normal View History

let fibonacci := (number) -> {
if (number < 2) {
return number;
} else {
return fibonacci(number - 1) + fibonacci(number - 2);
}
}
print(fibonacci(6))
2024-08-30 11:51:36 +02:00
fun hogonacci(number) {
if (number < 2) {
return number;
} else {
return hogonacci(number - 1) + hogonacci(number - 2);
}
}
print(hogonacci(6))