Prove recursion works

This commit is contained in:
greg 2017-01-02 23:39:18 -08:00
parent edf342e65a
commit 2722533efd

24
recurse.schala Normal file
View File

@ -0,0 +1,24 @@
fn hella(x)
print("hey")
if x == 3 then
Null
else
hella(x + 1)
end
end
hella(0)
fn fib(x)
if x < 3 then
1
else
fib(x - 1) + fib(x - 2)
end
end
fib(10)