examples/fibonacci.hss
// A quick fibonacci example. Currently returns true if it has the correct result.
let fib = fn(x) {
if (x == 0) {
return 0;
}
if (x == 1) {
return 1;
}
return fib(x-1) + fib(x-2);
}
let main = fn() {
let fibTest = fib(10);
if (fibTest != 55) {
return false;
} else {
return true;
}
}
main();