forked from cory/tildefriends
Quick experiment with quickjs.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3423 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
10
deps/quickjs/examples/fib_module.js
vendored
Normal file
10
deps/quickjs/examples/fib_module.js
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
/* fib module */
|
||||
export function fib(n)
|
||||
{
|
||||
if (n <= 0)
|
||||
return 0;
|
||||
else if (n == 1)
|
||||
return 1;
|
||||
else
|
||||
return fib(n - 1) + fib(n - 2);
|
||||
}
|
Reference in New Issue
Block a user