aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-049/simon-proctor/raku/ch-1.p614
1 files changed, 7 insertions, 7 deletions
diff --git a/challenge-049/simon-proctor/raku/ch-1.p6 b/challenge-049/simon-proctor/raku/ch-1.p6
index 7e05281b98..a53c9166fb 100644
--- a/challenge-049/simon-proctor/raku/ch-1.p6
+++ b/challenge-049/simon-proctor/raku/ch-1.p6
@@ -6,13 +6,13 @@ use v6.d;
sub MAIN(
UInt $x #= Number to look for multiple of
) {
- my $current = 1;
- my $current-bin = $current.base(2);
-
- while ( ! ( $current-bin %% $x ) ) {
- $current++;
- $current-bin = $current.base(2);
+ my @seq = lazy gather {
+ my $current = 1;
+ loop {
+ take $current.base(2);
+ $current++;
+ }
}
- say $current-bin;
+ @seq.first( * %% $x ).say;
}