From 8bd960a42cdbdcfe59e8cf4ad92feb5eafacefdd Mon Sep 17 00:00:00 2001 From: Simon Proctor Date: Mon, 8 Jul 2019 15:21:38 +0100 Subject: Added a verbose option --- challenge-016/simon-proctor/perl6/ch-1.p6 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/challenge-016/simon-proctor/perl6/ch-1.p6 b/challenge-016/simon-proctor/perl6/ch-1.p6 index eff2f108e4..56ef06d167 100644 --- a/challenge-016/simon-proctor/perl6/ch-1.p6 +++ b/challenge-016/simon-proctor/perl6/ch-1.p6 @@ -1,7 +1,7 @@ use v6; #| Calculate the largest slace of Pie from Pythagoras Pie Puzzle -sub MAIN() { +sub MAIN( Bool :v($verbose) = False ) { my $cake = FatRat.new(1); my $slice = 0; my $person = 0; @@ -12,6 +12,7 @@ sub MAIN() { $slice = $nslice; $person = $size; } + say "Person $size gets {$nslice*100}%" if $verbose; } say "Person $person gets {$slice*100}% of the cake or {$slice.nude().join("/")}"; } \ No newline at end of file -- cgit