Add set index in list, and update lib+examples+tests

This commit is contained in:
Neemek 2026-08-20 13:44:10 +02:00
parent 09ac16a42d
commit 3bccc227ba
Signed by: neemek
GPG key ID: 84FFE4D7D40AB25E
12 changed files with 117 additions and 60 deletions

View file

@ -1,14 +1,15 @@
# This program computes the fibonacci numbers using recursion (O(2^n))
# It is very slow
func fib(x: number) number {
fn fib(x: number) number {
if x <= 1 {
return x
x
} else {
fib(x - 1) + fib(x - 2)
}
return fib(x - 1) + fib(x - 2)
}
n := 0
while n < 100 {
write(str(fib(n)))
println(fib(n))
n = n + 1
}