aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoneWolfiNTj <Hatley.Software@gmail.com>2023-01-22 13:34:15 -0800
committerLoneWolfiNTj <Hatley.Software@gmail.com>2023-01-22 13:34:15 -0800
commite80e6616a02316cde8aec2c9dba70d9a833a6d42 (patch)
tree26ff4ad05170c999a51c1031b61b042f77b82ed4
parenta51df1084746b8933569ba2cc60244ba5f2da816 (diff)
downloadperlweeklychallenge-club-e80e6616a02316cde8aec2c9dba70d9a833a6d42.tar.gz
perlweeklychallenge-club-e80e6616a02316cde8aec2c9dba70d9a833a6d42.tar.bz2
perlweeklychallenge-club-e80e6616a02316cde8aec2c9dba70d9a833a6d42.zip
Simplified mask.
-rwxr-xr-xchallenge-200/robbie-hatley/perl/ch-1.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/challenge-200/robbie-hatley/perl/ch-1.pl b/challenge-200/robbie-hatley/perl/ch-1.pl
index 19dab4fd9b..99f752f39b 100755
--- a/challenge-200/robbie-hatley/perl/ch-1.pl
+++ b/challenge-200/robbie-hatley/perl/ch-1.pl
@@ -48,7 +48,7 @@ sub get_arith_slices($array_ref){
foreach my $mask (@masks){ # For each possible mask,
my @slice = (); # create a slice.
for ( my $idx = 0 ; $idx <= $#array ; ++$idx ){ # For each index in @array,
- my $yesno = ($mask/2**($idx))%2; # examine corresponding binary digit in mask,
+ my $yesno = ($mask/2**$idx)%2; # examine corresponding binary digit in mask,
if ($yesno) {push @slice, $array[$idx]}} # and do-or-don't include $array[$idx] in @slice,
push @slices, \@slice;} # depending on whether digit is 0 or 1.
foreach my $slice_ref (@slices){ # But only return slices that are arithmetic.