diff options
Diffstat (limited to 'raku/bob/Bob.rakumod')
-rw-r--r-- | raku/bob/Bob.rakumod | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/raku/bob/Bob.rakumod b/raku/bob/Bob.rakumod new file mode 100644 index 0000000..ab6fa66 --- /dev/null +++ b/raku/bob/Bob.rakumod @@ -0,0 +1,15 @@ +unit class Bob; + +method hey (Str $msg is copy) { + $msg .= trim; + + given $msg.trim { + when .chars == 0 { "Fine. Be that way!" } + when $_ eq .uc && $_ ~~ /<[a..zA..Z]>/ { + return "Calm down, I know what I'm doing!" if $_.ends-with("?"); + "Whoa, chill out!"; + } + when .ends-with("?") { "Sure." } + default { "Whatever." } + } +} |