aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Mochan <mochan@fis.unam.mx>2022-11-20 13:20:14 -0600
committerLuis Mochan <mochan@fis.unam.mx>2022-11-20 13:20:14 -0600
commit3b33fea6b629ea70479ed7188a86987cfa6d7b1e (patch)
tree585959ccb15d87621f712919f839ffd1150e2677
parent3cf4338ff3149c736057952fbdf7b4817bac72d6 (diff)
downloadperlweeklychallenge-club-3b33fea6b629ea70479ed7188a86987cfa6d7b1e.tar.gz
perlweeklychallenge-club-3b33fea6b629ea70479ed7188a86987cfa6d7b1e.tar.bz2
perlweeklychallenge-club-3b33fea6b629ea70479ed7188a86987cfa6d7b1e.zip
Correct small mistake
-rwxr-xr-xchallenge-191/wlmb/perl/ch-2d.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/challenge-191/wlmb/perl/ch-2d.pl b/challenge-191/wlmb/perl/ch-2d.pl
index 440b19dcfc..640ed3cc59 100755
--- a/challenge-191/wlmb/perl/ch-2d.pl
+++ b/challenge-191/wlmb/perl/ch-2d.pl
@@ -34,7 +34,7 @@ sub cute($n){ # return an iterator to generate all cute sequences of length $n
return([$candidate, @$cute], {$candidate, 1, %$seen})
unless $seen->{$candidate};
}
- return () unless ($cute, $seen)=$it->(); # next subsequence or return
+ ($cute, $seen)=$it->() or return (); # next subsequence or return
$candidates=listit(@set); # reinitalize iterator for candidates
}
}
@@ -46,7 +46,7 @@ die << "EOF" unless @ARGV;
Usage: $0 N1 [N2...]
to count the cute orderings of 1..Ni
EOF
-warn "Numbers beyond 20 will require patience" unless all {1<=$_<=18} @ARGV;
+warn "Numbers beyond 20 will require patience" unless all {1<=$_<=20} @ARGV;
for(@ARGV){
my $count=0;
my $it=cute($_);