aboutsummaryrefslogtreecommitdiff
path: root/examples/for.fco
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2024-04-19 20:21:56 +0100
committerJuan J. Martinez <jjm@usebox.net>2024-04-19 20:25:26 +0100
commit044360219f2e4e0b5b5a95cb7ede00753340d61d (patch)
tree4c2341a6e4941b3c3b70ca9941699e8f84353901 /examples/for.fco
downloadfunco-044360219f2e4e0b5b5a95cb7ede00753340d61d.tar.gz
funco-044360219f2e4e0b5b5a95cb7ede00753340d61d.zip
Initial import
Diffstat (limited to 'examples/for.fco')
-rw-r--r--examples/for.fco11
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/for.fco b/examples/for.fco
new file mode 100644
index 0000000..9710fe2
--- /dev/null
+++ b/examples/for.fco
@@ -0,0 +1,11 @@
+# recursive for loop
+def for(n fn)
+ if >(n 0)
+ fn(n)
+ @for(-(n 1) fn)
+ end
+end
+
+def main()
+ for(10000 display)
+end