Skip to content

Instantly share code, notes, and snippets.

@Iainmon
Created October 20, 2019 05:23
Show Gist options
  • Select an option

  • Save Iainmon/7ce9f1800de80b8ca88e37a58be8a091 to your computer and use it in GitHub Desktop.

Select an option

Save Iainmon/7ce9f1800de80b8ca88e37a58be8a091 to your computer and use it in GitHub Desktop.
/// <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