aboutsummaryrefslogtreecommitdiff
path: root/challenge-243
diff options
context:
space:
mode:
authorrobbie-hatley <Hatley.Software@gmail.com>2023-11-15 08:51:54 -0800
committerrobbie-hatley <Hatley.Software@gmail.com>2023-11-15 08:51:54 -0800
commit45dde2825a40a6296949f33d1004ae51e006c940 (patch)
tree8c304ad937e46bb768611db7878b9e8354b20631 /challenge-243
parent928927686b98f953cedfbf54b325f5c9ea8c7cad (diff)
downloadperlweeklychallenge-club-45dde2825a40a6296949f33d1004ae51e006c940.tar.gz
perlweeklychallenge-club-45dde2825a40a6296949f33d1004ae51e006c940.tar.bz2
perlweeklychallenge-club-45dde2825a40a6296949f33d1004ae51e006c940.zip
Updated 243-1
Diffstat (limited to 'challenge-243')
-rwxr-xr-xchallenge-243/robbie-hatley/perl/ch-1.pl4
-rwxr-xr-xchallenge-243/robbie-hatley/perl/ch-2.pl1
2 files changed, 4 insertions, 1 deletions
diff --git a/challenge-243/robbie-hatley/perl/ch-1.pl b/challenge-243/robbie-hatley/perl/ch-1.pl
index 828d630b59..33fdb09fe1 100755
--- a/challenge-243/robbie-hatley/perl/ch-1.pl
+++ b/challenge-243/robbie-hatley/perl/ch-1.pl
@@ -78,7 +78,9 @@ sub reverse_pairs ($aref) {
my @rp = ();
for ( my $i = 0 ; $i <= $#$aref - 1 ; ++$i ) {
for ( my $j = $i + 1 ; $j <= $#$aref - 0 ; ++$j ) {
- push @rp, [$$aref[$i], $$aref[$j]] if $$aref[$i] > 2 * $$aref[$j];
+ if ( $$aref[$i] > 2 * $$aref[$j] ) {
+ push @rp, [$$aref[$i], $$aref[$j]];
+ }
}
}
return @rp
diff --git a/challenge-243/robbie-hatley/perl/ch-2.pl b/challenge-243/robbie-hatley/perl/ch-2.pl
index cc410fa8b1..e19098da7b 100755
--- a/challenge-243/robbie-hatley/perl/ch-2.pl
+++ b/challenge-243/robbie-hatley/perl/ch-2.pl
@@ -43,6 +43,7 @@ Output: 49
PROBLEM NOTES:
I'll use two three-part loops to sum all floors of pair quotients.
+
--------------------------------------------------------------------------------------------------------------
IO NOTES:
Input is via either built-in variables or via @ARGV. If using @ARGV, provide one argument which must be a