LPST.pm - parametrized shade

This commit is contained in:
gashapwn 2021-04-07 00:35:47 +00:00
parent e3c07ef59f
commit 2001529ded
2 changed files with 11 additions and 7 deletions

16
LPST.pm
View File

@ -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");

View File

@ -28,5 +28,5 @@ my $b;
$b = LPST->new();
$b->shade_all_mvmt("P1");
# $b->shade_all_p1_mvmt();
$b->disp_board();