aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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