Created
October 18, 2019 02:49
-
-
Save christineponyl/791b6824c3475c71d14502ccdb94715e to your computer and use it in GitHub Desktop.
Shared via Pony Playground (https://playground.ponylang.io/?gist=791b6824c3475c71d14502ccdb94715e)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actor Main | |
let env: Env | |
new create(env': Env) => | |
env = env' | |
env.out.print(fib(5).string()) | |
fun fib(n: U64): U64 => | |
match n | |
| 0 => 0 | |
| 1 => 1 | |
else | |
fib(n - 1) + fib(n - 2) | |
env.out.print(n.string()) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment