From 044360219f2e4e0b5b5a95cb7ede00753340d61d Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Fri, 19 Apr 2024 20:21:56 +0100 Subject: Initial import --- examples/fib.fco | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 examples/fib.fco (limited to 'examples/fib.fco') diff --git a/examples/fib.fco b/examples/fib.fco new file mode 100644 index 0000000..d459341 --- /dev/null +++ b/examples/fib.fco @@ -0,0 +1,13 @@ +# fibonacci number +def fib(n) + if <(n 2) + n + else + +(fib(- (n 1)) fib(- (n 2))) + end +end + +def main() + display("Running fib(20)...") + display(fib(20)) +end -- cgit v1.2.3