diff options
| author | Jaldhar H. Vyas <jaldhar@braincells.com> | 2020-03-28 02:39:40 -0400 |
|---|---|---|
| committer | Jaldhar H. Vyas <jaldhar@braincells.com> | 2020-03-28 02:39:40 -0400 |
| commit | 5e2d95767d6dc6b2cf97135f6a4fca6be54e0b06 (patch) | |
| tree | e2708f4826af95eca09fc19bba6f8a68f374d1c3 | |
| parent | 859d6b6fbb1c4e6008fafbf8fdaed3ffe0e8cfac (diff) | |
| download | perlweeklychallenge-club-5e2d95767d6dc6b2cf97135f6a4fca6be54e0b06.tar.gz perlweeklychallenge-club-5e2d95767d6dc6b2cf97135f6a4fca6be54e0b06.tar.bz2 perlweeklychallenge-club-5e2d95767d6dc6b2cf97135f6a4fca6be54e0b06.zip | |
formal MAIN() sub for task 2 Raku version.
| -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 |
