aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorE. Choroba <choroba@matfyz.cz>2020-10-14 00:50:25 +0200
committerE. Choroba <choroba@matfyz.cz>2020-10-14 00:50:25 +0200
commitf9364ac6a1930278e9b56f7165ab3f3a9744990e (patch)
tree46c34a371749625afadaa044480e8487a970295b
parent5138746d33e905dcd074919a6f78a5620f67eb5b (diff)
downloadperlweeklychallenge-club-f9364ac6a1930278e9b56f7165ab3f3a9744990e.tar.gz
perlweeklychallenge-club-f9364ac6a1930278e9b56f7165ab3f3a9744990e.tar.bz2
perlweeklychallenge-club-f9364ac6a1930278e9b56f7165ab3f3a9744990e.zip
Update 080/2 - defined not needed, add Colin's test
-rwxr-xr-xchallenge-080/e-choroba/perl/ch-2.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/challenge-080/e-choroba/perl/ch-2.pl b/challenge-080/e-choroba/perl/ch-2.pl
index 394bec7202..1334624275 100755
--- a/challenge-080/e-choroba/perl/ch-2.pl
+++ b/challenge-080/e-choroba/perl/ch-2.pl
@@ -35,7 +35,7 @@ sub count_candies {
}
}
}
- return @$n + sum(grep defined, @candies)
+ return @$n + sum(@candies)
}
use Test::More;
@@ -50,6 +50,8 @@ is count_candies(
[1, 9, 10, 10, 0, 8, 9, 6, 2, 8, 0, 1, 3, 3, 1, 10, 1, 3, 8, 8]
), 37;
+is count_candies([qw[ 1 9 5 2 6 8 9 10 2 5 1 ]]), 25, 'Colin';
+
done_testing();
__END__