summaryrefslogtreecommitdiff
path: root/fizzbuzz.bþ
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-06-21 00:25:55 +0100
committerubq323 <ubq323@ubq323.website>2024-06-21 00:25:55 +0100
commita03973653262fbbfed7ce42dfa39646d16bdc98f (patch)
treefcf222d1e67b715af8173fda8edcab3b6c0793cd /fizzbuzz.bþ
parentf331192861d8ba02af7fd47f2e0c6d6db7515007 (diff)
while loops, comparisons, modulo, fizzbuzz
Diffstat (limited to 'fizzbuzz.bþ')
-rw-r--r--fizzbuzz.bþ10
1 files changed, 10 insertions, 0 deletions
diff --git a/fizzbuzz.bþ b/fizzbuzz.bþ
new file mode 100644
index 0000000..e70c2c1
--- /dev/null
+++ b/fizzbuzz.bþ
@@ -0,0 +1,10 @@
+(do
+ (set n 1)
+ (while (< n 30)
+ (print
+ (if (= 0 (% n 5))
+ (if (= 0 (% n 3)) "fizzbuzz" "buzz")
+ (if (= 0 (% n 3)) "fizz" n)))
+ (set n (+ n 1))))
+
+