From 2001529ded90ec5de4c51e2872d65e86ba378f30 Mon Sep 17 00:00:00 2001 From: gashapwn Date: Wed, 7 Apr 2021 00:35:47 +0000 Subject: [PATCH] LPST.pm - parametrized shade --- LPST.pm | 16 ++++++++++------ ntvl.pl | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/LPST.pm b/LPST.pm index 1406c6b..fade2fc 100644 --- a/LPST.pm +++ b/LPST.pm @@ -675,21 +675,25 @@ sub shade_pi_mvmt($$){ } } -sub shade_all_mvmt($){ - my $pl; +sub shade_all_mvmt($$){ + my ($pl, $en) = (shift, shift); my @pi1; - $pl = shift; + # $pl = shift; @pi1 = grep { cell_pl($_) eq $pl } keys(%board); for my $el (@pi1){ - shade_pi_mvmt($el, $MOVBLOCK_ENUM); + shade_pi_mvmt($el, $en); } } +sub shade_all_p1_mvmt($){ + shade_all_mvmt($P1, $MOVBLOCK_ENUM); +} + sub get_block_cell($){ my $pl; @@ -723,10 +727,10 @@ sub new { return bless $self, $class; } +binmode(STDOUT, ":utf8"); + return 1; -# Is this needed? -# binmode(STDOUT, ":utf8"); diff --git a/ntvl.pl b/ntvl.pl index 5c875a3..94fbc81 100644 --- a/ntvl.pl +++ b/ntvl.pl @@ -28,5 +28,5 @@ my $b; $b = LPST->new(); -$b->shade_all_mvmt("P1"); +# $b->shade_all_p1_mvmt(); $b->disp_board();