From f398971421d9c5dad7d3b45aac75458893f14d8a Mon Sep 17 00:00:00 2001 From: robbie-hatley Date: Sat, 6 Jul 2024 09:15:26 -0700 Subject: Changed for loops in 276-1 from three-part to ranged. --- challenge-276/robbie-hatley/perl/ch-1.pl | 4 ++-- 1 file 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; } } -- cgit