From 45b047db40e2c60c1373219508632baf823e9638 Mon Sep 17 00:00:00 2001 From: Manuel Palenzuela Merino Date: Sat, 18 Jan 2025 20:29:40 +0100 Subject: Examples: add future examples :^) --- examples/7.src | 10 ++++++++++ examples/8.src | 15 +++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 examples/7.src create mode 100644 examples/8.src (limited to 'examples') diff --git a/examples/7.src b/examples/7.src new file mode 100644 index 0000000..36796cb --- /dev/null +++ b/examples/7.src @@ -0,0 +1,10 @@ +let main = () => { + let i = 4; + + if i == 4 { + print(i); + return i; + } + + return 1; +}; diff --git a/examples/8.src b/examples/8.src new file mode 100644 index 0000000..75b5c56 --- /dev/null +++ b/examples/8.src @@ -0,0 +1,15 @@ +let fib = (n) => { + if n == 0 { + return 0; + } + if n == 1 { + return 1; + } + return fib(n-2) + fib(n-1); +}; + +let main = () => { + let result = fib(7); + print(result); + return result; +}; -- cgit 1.4.1