Skip to content

Instantly share code, notes, and snippets.

@christineponyl
Created October 18, 2019 13:30
Show Gist options
  • Save christineponyl/db32e71bb2552617f83450b28535481e to your computer and use it in GitHub Desktop.
Save christineponyl/db32e71bb2552617f83450b28535481e to your computer and use it in GitHub Desktop.
actor Main
new create(env: Env) =>
env.out.print(fib(5, env.out).string())
fun fib(n: U64, out: OutStream): U64 =>
match n
| 0 => 0
| 1 => 1
else
let n1 = n - 1
let n2 = n - 2
out.print(n.string()) // -I need to print right here
fib(n - 1, out) + fib(n - 2, out)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment