diff options
| author | drbaggy <js5@sanger.ac.uk> | 2022-01-12 01:48:10 +0000 |
|---|---|---|
| committer | drbaggy <js5@sanger.ac.uk> | 2022-01-12 01:48:10 +0000 |
| commit | 94cdbab3f1198c78a3dcedb9ada1a8596114cfcb (patch) | |
| tree | 21306d2db9e282b3a13736372d1279b6e800a0f6 /challenge-147/james-smith/README.md | |
| parent | 5917dbe80858568f3781e214430ecb9e5afe93db (diff) | |
| download | perlweeklychallenge-club-94cdbab3f1198c78a3dcedb9ada1a8596114cfcb.tar.gz perlweeklychallenge-club-94cdbab3f1198c78a3dcedb9ada1a8596114cfcb.tar.bz2 perlweeklychallenge-club-94cdbab3f1198c78a3dcedb9ada1a8596114cfcb.zip | |
last unless replaced by ||last
Diffstat (limited to 'challenge-147/james-smith/README.md')
| -rw-r--r-- | challenge-147/james-smith/README.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/challenge-147/james-smith/README.md b/challenge-147/james-smith/README.md index 6941c1b663..13e84e0c1b 100644 --- a/challenge-147/james-smith/README.md +++ b/challenge-147/james-smith/README.md @@ -49,7 +49,7 @@ my @tprimes_current = (3,7); printf $TEMPLATE, ++$index, $_, time-$t0 for 2,3,5,7; while(1) { # ** Stop if there are no primes of length `n`. - last unless @tprimes_current; + @tprimes_current||last; my @tprimes_new = (); # ** Loop through each of possible left-truncatable primes... for my $first ( 1..9 ) { @@ -109,7 +109,7 @@ my @tprimes_current = (2,3,5,7); printf $TEMPLATE, ++$idx, $_, time - $t0 foreach @tprimes_current; for my $p ( 1 .. 100 ) { - last unless @tprimes_current; + @tprimes_current||last; my @tprimes_new = (); foreach my $base ( @tprimes_current ) { B: foreach my $last ( 1,3,7,9 ) { |
