lpst.pl - refactored shade_move to remove redundant arrays

This commit is contained in:
gashapwn 2021-04-04 23:25:25 +00:00
parent 8dbc330d45
commit 3af63ea303

15
lpst.pl
View File

@ -589,26 +589,21 @@ sub shade_move($$){
my ($not, $en) = (shift, shift);
my $c1;
my @mv1;
my @mv2;
$c1 = cell_pi($not);
@mv1 = map {
$_
} grep {
($_->{"type"} && $en) eq $en
}@{$MOVE{$c1}};
@mv2 = grep {
@mv1 = grep {
$_ if $_->[0] ne $ERR_C_1;
} map {
[
calc_move($not, $_->{"mov"}),
$_->{"type"}
]
} @mv1;
} grep {
($_->{"type"} && $en) eq $en
} @{$MOVE{$c1}};
for my $mv (@mv2){
for my $mv (@mv1){
shade_cell($mv->[0], $mv->[1]);
}
}