aoc2015

Advent of Code 2015 solutions in Perl.
git clone git://git.samirparikh.com/aoc2015
Log | Files | Refs | README

commit 6851cf3763e5861ab7c39fbc18f9f5a9c30cce9b
parent 37c9591e1973959bb87c6c8e5c832f5acb43da13
Author: Samir Parikh <noreply@samirparikh.com>
Date:   Wed, 26 Oct 2022 19:20:15 +0000

solve part 1 of day07

Diffstat:
Mday07/Day07.pm | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/day07/Day07.pm b/day07/Day07.pm @@ -34,7 +34,7 @@ sub evaluate { } # specific value - if ( $operation =~ m/\A(\d+)\z/ ) { + elsif ( $operation =~ m/\A(\d+)\z/ ) { say "kick it"; $signal{ $index } = $1; #return $signal{ $index }; @@ -54,16 +54,16 @@ sub evaluate { say "my operation is now '$left, $operand, $right'"; if ( $operand eq 'AND' ) { - say "we've got an AND in $operation"; + say "we've got an AND in $operation. Evaluating $left and $right."; $signal{ $index } = $left & $right; } elsif ( $operand eq 'OR' ) { - say "we've got an OR in $operation"; + say "we've got an OR in $operation. Evaluating $left and $right."; $signal{ $index } = $left | $right; } elsif ( $operand eq 'LSHIFT' ) { - say "we've got an LSHIFT in $operation"; + say "we've got an LSHIFT in $operation. Evaluating $left and $right."; $signal{ $index } = $left << $right; } elsif ( $operand eq 'RSHIFT' ) { - say "we've got an RSHIFT in $operation"; + say "we've got an RSHIFT in $operation. Evaluating $left and $right."; $signal{ $index } = $left >> $right; } else { die "Could not parse operation.";