Added trivial fibonacci implementation
ci/woodpecker/push/woodpecker Pipeline was successful Details

pull/14/head
Jef Roosens 2022-01-08 23:14:07 +01:00
parent d80d320483
commit fff440ee98
Signed by: Jef Roosens
GPG Key ID: 955C0660072F691F
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,9 @@
module fibonacci
pub fn fib(i int) int {
if i <= 1 {
return i
}
return fib(i - 1) + fib(i - 2)
}

View File

@ -1,3 +1,9 @@
import fibonacci
fn main() { fn main() {
println('Hello, world!') println('Hello, world!')
for i in 1 .. 35 {
println('$i - ${fibonacci.fib(i)}')
}
} }