aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobbie-hatley <Robbie.Hatley@gmail.com>2024-01-17 20:27:22 -0800
committerrobbie-hatley <Robbie.Hatley@gmail.com>2024-01-17 20:27:22 -0800
commit81455cd0c01e629908ea9f1437fac5864669c279 (patch)
treee237c6d79759db6f0f8f63d863c58a05ab54c6ff
parent0601a6a3f12c64f5687246b5ef2707eff294acef (diff)
downloadperlweeklychallenge-club-81455cd0c01e629908ea9f1437fac5864669c279.tar.gz
perlweeklychallenge-club-81455cd0c01e629908ea9f1437fac5864669c279.tar.bz2
perlweeklychallenge-club-81455cd0c01e629908ea9f1437fac5864669c279.zip
Corrected some minor errors.
-rwxr-xr-xchallenge-252/robbie-hatley/perl/ch-2.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/challenge-252/robbie-hatley/perl/ch-2.pl b/challenge-252/robbie-hatley/perl/ch-2.pl
index 119ba7629e..4edb5e4b68 100755
--- a/challenge-252/robbie-hatley/perl/ch-2.pl
+++ b/challenge-252/robbie-hatley/perl/ch-2.pl
@@ -77,8 +77,8 @@ sub is_pos_int ($x) {
return $x =~ m/^[1-9]\d*$/;
}
+# Return array of unique ints adding to $n:
sub usz ($n) {
- return ('$n not pos int') if !is_pos_int($n);
my @a = ();
push @a, -int($n/2)..-1;
1 == $n%2 and push @a, 0;