diff options
| -rw-r--r-- | challenge-075/simon-proctor/raku/ch-1.raku | 7 |
1 files changed, 6 insertions, 1 deletions
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; |
