From 8e487aa6a65d5e05e55bd8d17e819e70d025a7b9 Mon Sep 17 00:00:00 2001 From: Simon Proctor Date: Tue, 25 Aug 2020 17:23:40 +0100 Subject: Now added a verbose option --- challenge-075/simon-proctor/raku/ch-1.raku | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/challenge-075/simon-proctor/raku/ch-1.raku b/challenge-075/simon-proctor/raku/ch-1.raku index 1ff6b48cfc..f907ee7190 100644 --- a/challenge-075/simon-proctor/raku/ch-1.raku +++ b/challenge-075/simon-proctor/raku/ch-1.raku @@ -2,12 +2,17 @@ use v6; +my %*SUB-MAIN-OPTS = :named-anywhere; + #| Given an amount and a list of valid coins show all the combinations of change sub MAIN ( UInt $amount where * > 0, #= Amount to make change of *@coins where { .all ~~ Int && .all > 0 }, #= Valid coins + Bool :v(:$verbose) = False, #= Print the complete list of combinations ) { - .join(", ").say for make-change( $amount, @coins ); + my @change = make-change( $amount, @coins ); + say @change.elems; + if $verbose { .join(", ").say for @change } } my %change_cache; -- cgit