From 5e2d95767d6dc6b2cf97135f6a4fca6be54e0b06 Mon Sep 17 00:00:00 2001 From: "Jaldhar H. Vyas" Date: Sat, 28 Mar 2020 02:39:40 -0400 Subject: formal MAIN() sub for task 2 Raku version. --- challenge-052/jaldhar-h-vyas/raku/ch-2.p6 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'challenge-052') 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 -- cgit