aboutsummaryrefslogtreecommitdiff
path: root/challenge-276
diff options
context:
space:
mode:
authorrobbie-hatley <Robbie.Hatley@gmail.com>2024-07-06 09:15:26 -0700
committerrobbie-hatley <Robbie.Hatley@gmail.com>2024-07-06 09:15:26 -0700
commitf398971421d9c5dad7d3b45aac75458893f14d8a (patch)
tree9addb134c7398c69ec956d107214f7196576ee76 /challenge-276
parent4d253b0c4d9564791acb79edcfb21df5ba282903 (diff)
downloadperlweeklychallenge-club-f398971421d9c5dad7d3b45aac75458893f14d8a.tar.gz
perlweeklychallenge-club-f398971421d9c5dad7d3b45aac75458893f14d8a.tar.bz2
perlweeklychallenge-club-f398971421d9c5dad7d3b45aac75458893f14d8a.zip
Changed for loops in 276-1 from three-part to ranged.
Diffstat (limited to 'challenge-276')
-rwxr-xr-xchallenge-276/robbie-hatley/perl/ch-1.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/challenge-276/robbie-hatley/perl/ch-1.pl b/challenge-276/robbie-hatley/perl/ch-1.pl
index 560b9ba3f4..555b5cc726 100755
--- a/challenge-276/robbie-hatley/perl/ch-1.pl
+++ b/challenge-276/robbie-hatley/perl/ch-1.pl
@@ -53,8 +53,8 @@ Output is to STDOUT and will be each input followed by the corresponding output.
use v5.38;
sub complete_days (@times) {
my $cds = 0;
- for ( my $i = 0 ; $i <= $#times - 1 ; ++$i ) {
- for ( my $j = $i + 1 ; $j <= $#times - 0 ; ++$j ) {
+ for my $i ( 0 .. $#times - 1 ) {
+ for my $j ( $i + 1 .. $#times - 0 ) {
0 == ($times[$i]+$times[$j])%24 and ++$cds;
}
}