Mercurial > hg > Papers > 2019 > anatofuz-thesis
view paper/codes/fizzbuzz.p6 @ 122:a3ff00c33fd7 default tip
update slide
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 20 Feb 2019 12:05:38 +0900 |
parents | a456a90f9f35 |
children |
line wrap: on
line source
my subset Fizz of Int where * %% 3; my subset Buzz of Int where * %% 5; my subset FizzBuzz of Int where Fizz&Buzz; my subset OtherNumber of Int where none Fizz|Buzz; proto sub fizzbuzz ($) { * } multi sub fizzbuzz (FizzBuzz) { "FuzzBuzz" } multi sub fizzbuzz (Fizz) { "Fizz" } multi sub fizzbuzz (Buzz) { "Buzz" } multi sub fizzbuzz (OtherNumber $number) { $number } fizzbuzz($_).say for 1..15;