aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2024-05-26 21:50:17 +0100
committerJuan J. Martinez <jjm@usebox.net>2024-05-26 21:50:17 +0100
commit16825c1f6cb8aada73b6c3a9ce1af4a85041b880 (patch)
treed15771c444b5ccd0da2553ffc746fc7520c15d10
parent3457f7d094667c1b5a509f76987149894b6e2622 (diff)
downloadfunco-16825c1f6cb8aada73b6c3a9ce1af4a85041b880.tar.gz
funco-16825c1f6cb8aada73b6c3a9ce1af4a85041b880.zip
Use range
-rw-r--r--examples/fizzbuzz.fco14
1 files changed, 1 insertions, 13 deletions
diff --git a/examples/fizzbuzz.fco b/examples/fizzbuzz.fco
index 7474ed7..d2d510d 100644
--- a/examples/fizzbuzz.fco
+++ b/examples/fizzbuzz.fco
@@ -14,18 +14,6 @@ def fizzbuzz(n)
end
end
-# generate a list of numbers from n to top
-def genlist(n top)
- def rec(l n top)
- if <=(n top)
- @rec(+(l list(n)) +(n 1) top)
- else
- l
- end
- end
- rec(list() n top)
-end
-
def main()
- display(map(fizzbuzz genlist(1 20)))
+ display(map(fizzbuzz ..(1 20)))
end