Created
October 20, 2019 05:23
-
-
Save Iainmon/7ce9f1800de80b8ca88e37a58be8a091 to your computer and use it in GitHub Desktop.
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
| /// <reference path="../node_modules/assemblyscript/index.d.ts" /> | |
| declare type u64 = number; | |
| // Recursive Fibonacci function | |
| export function fib(n: u64): u64 { | |
| if (n <= 1) { | |
| return n; | |
| } | |
| return fib(n - 1) + fib(n - 2); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment