diff options
Diffstat (limited to 'challenge-052')
| -rwxr-xr-x | challenge-052/jaldhar-h-vyas/raku/ch-2.p6 | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/challenge-052/jaldhar-h-vyas/raku/ch-2.p6 b/challenge-052/jaldhar-h-vyas/raku/ch-2.p6 index 7f8900b6db..44f88f6532 100755 --- a/challenge-052/jaldhar-h-vyas/raku/ch-2.p6 +++ b/challenge-052/jaldhar-h-vyas/raku/ch-2.p6 @@ -29,10 +29,13 @@ sub run(Bool $playerTurn_) { } } -say 'Assuming both take the best coin...'; -for (True, False) -> $playerTurn { - print 'If the ', ($playerTurn ?? 'player' !! 'computer'), ' goes first, '; - my ($winner, $amount) = run($playerTurn); - print 'the ', ($winner ?? 'player' !! 'computer'), ' wins with £', - $amount, ".\n"; +multi sub MAIN() { + say 'Assuming both take the best coin...'; + for (True, False) -> $playerTurn { + print 'If the ', ($playerTurn ?? 'player' !! 'computer'), + ' goes first, '; + my ($winner, $amount) = run($playerTurn); + print 'the ', ($winner ?? 'player' !! 'computer'), ' wins with £', + $amount, ".\n"; + } }
\ No newline at end of file |
