diff options
Diffstat (limited to 'raku/raindrops/Raindrops.rakumod')
-rw-r--r-- | raku/raindrops/Raindrops.rakumod | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/raku/raindrops/Raindrops.rakumod b/raku/raindrops/Raindrops.rakumod new file mode 100644 index 0000000..3b41065 --- /dev/null +++ b/raku/raindrops/Raindrops.rakumod @@ -0,0 +1,9 @@ +unit module Raindrops; + +sub raindrop(Int $num --> Str) is export { + my Str $res; + $res ~= "Pling" if $num %% 3; + $res ~= "Plang" if $num %% 5; + $res ~= "Plong" if $num %% 7; + return $res // $num.Str; +} |