Skip to content

Commit 81d99c8

Browse files
committed
Make progress output optional
1 parent a461d85 commit 81d99c8

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

categories/euler/prob063-moritz.pl

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,18 @@
1818
1919
=end pod
2020

21-
my $count = 0;
22-
for 1..9 -> $x {
23-
for 1..200 -> $y {
24-
if ($x**$y).chars == $y {
25-
say "$x**$y";
26-
$count++;
21+
sub MAIN(Bool :$verbose = False) {
22+
my $count = 0;
23+
for 1..9 -> $x {
24+
for 1..200 -> $y {
25+
if ($x**$y).chars == $y {
26+
say "$x**$y" if $verbose;
27+
$count++;
28+
}
2729
}
2830
}
31+
say $count;
32+
say "missing bigint support: answer should be 49" if $verbose;
2933
}
30-
say $count;
31-
say "missing bigint support: answer should be 49";
3234

3335
# vim: expandtab shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)