diff options
Diffstat (limited to 'js/scripting-lang/scratch_tests/test_fizzbuzz_only.txt')
-rw-r--r-- | js/scripting-lang/scratch_tests/test_fizzbuzz_only.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/scripting-lang/scratch_tests/test_fizzbuzz_only.txt b/js/scripting-lang/scratch_tests/test_fizzbuzz_only.txt new file mode 100644 index 0000000..2fd12ad --- /dev/null +++ b/js/scripting-lang/scratch_tests/test_fizzbuzz_only.txt @@ -0,0 +1,13 @@ +/* Test just the FizzBuzz part */ + +/* Classic FizzBuzz using multi-value patterns with expressions */ +fizzbuzz : n -> + when (n % 3) (n % 5) is + 0 0 then "FizzBuzz" + 0 _ then "Fizz" + _ 0 then "Buzz" + _ _ then n; + +/* Test FizzBuzz implementation */ +fizzbuzz_15 : fizzbuzz 15; +..out fizzbuzz_15; \ No newline at end of file |