aoc2021

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

commit 6ee41c4801c2f827490a4bc6f0a5e4ebc87ef825
parent a29521cf38e95af24e41e89eb5cb3ec0e4c1112a
Author: Samir Parikh <noreply@samirparikh.com>
Date:   Sun,  5 Dec 2021 17:16:31 +0000

prettify print_board_state subroutine

Diffstat:
Mday04-1.pl | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/day04-1.pl b/day04-1.pl @@ -79,11 +79,11 @@ sub print_board_state { foreach my $board (@$boards) { # $board is ref to board array foreach my $row (@$board) { # $row is ref to board row array foreach my $column (@$row) { # $column is element of row array - print "$boards\t$board\t$row\t"; + print "$board\t$row\t"; if ($state->{$board}{$row}{$column} == 1) { - say "-> $column <-"; + printf "-> %2d <-\n", $column; } else { - say "$column"; + printf " %2d\n", $column; } } }