aboutsummaryrefslogtreecommitdiffhomepage
path: root/samples/rosetta/fizzBuzz.bruijn
diff options
context:
space:
mode:
authorMarvin Borner2024-03-25 18:59:03 +0100
committerMarvin Borner2024-03-25 18:59:48 +0100
commit14e38ce378236cf54924b58396168c1e94f8e6b2 (patch)
treeecbbb75517695de8897a2a9c58aa1a97ec2546f5 /samples/rosetta/fizzBuzz.bruijn
parentf8398804d351667a7b887b89f6f70c7d5c407d22 (diff)
Improved samples by adding links to problems
Diffstat (limited to 'samples/rosetta/fizzBuzz.bruijn')
-rw-r--r--samples/rosetta/fizzBuzz.bruijn11
1 files changed, 11 insertions, 0 deletions
diff --git a/samples/rosetta/fizzBuzz.bruijn b/samples/rosetta/fizzBuzz.bruijn
new file mode 100644
index 0000000..7f61704
--- /dev/null
+++ b/samples/rosetta/fizzBuzz.bruijn
@@ -0,0 +1,11 @@
+:import std/Combinator .
+:import std/String .
+:import std/Number .
+
+main [y [[0 =? (+101) case-end case-rec]] (+1)]
+ case-rec str ++ "\n" ++ (1 ++0)
+ str fizzbuzz "FizzBuzz" (fizz "Fizz" (buzz "Buzz" (number→string 0)))
+ fizz =?(0 % (+3))
+ buzz =?(0 % (+5))
+ fizzbuzz fizz buzz fizz
+ case-end empty