From 0f942f4fb8bf474b8677ad25a4cde9af7c96c501 Mon Sep 17 00:00:00 2001 From: gashapwn Date: Sun, 4 Apr 2021 23:34:44 +0000 Subject: [PATCH] lpst.pl - fixed bug with checking MOVBLOCK spaces --- lpst.pl | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lpst.pl b/lpst.pl index 275cc89..50aecd8 100644 --- a/lpst.pl +++ b/lpst.pl @@ -238,7 +238,7 @@ my %MOVE = ( MoveStruct->new("mov" => [ 1, 0], "type" => $MOVE_ENUM), MoveStruct->new("mov" => [ 1,-1], "type" => $MOVE_ENUM) ], - $MG_QS => [ + $MG_QS => [ MoveStruct->new("mov" => [-3, 3], "type" => $MOVE_ENUM), MoveStruct->new("mov" => [-2, 2], "type" => $MOVE_ENUM), MoveStruct->new("mov" => [-2, 0], "type" => $MOVE_ENUM), @@ -254,9 +254,11 @@ my %MOVE = ( MoveStruct->new("mov" => [ 1,-1], "type" => $MOVE_ENUM), MoveStruct->new("mov" => [ 2, 0], "type" => $MOVE_ENUM), MoveStruct->new("mov" => [ 2,-2], "type" => $MOVE_ENUM), - MoveStruct->new("mov" => [ 3,-3], "type" => $MOVE_ENUM) - ], - $MG_AU => [ + MoveStruct->new("mov" => [ 3,-3], "type" => $MOVE_ENUM), + MoveStruct->new("mov" => [ 3, 0], "type" => $MOVE_ENUM), + MoveStruct->new("mov" => [-3, 0], "type" => $MOVE_ENUM) + ], + $MG_AU => [ MoveStruct->new("mov" => [-1, 0], "type" => $MOVE_ENUM), MoveStruct->new("mov" => [-1, 1], "type" => $MOVE_ENUM), MoveStruct->new("mov" => [ 0, 1], "type" => $MOVE_ENUM), @@ -264,7 +266,7 @@ my %MOVE = ( MoveStruct->new("mov" => [ 1, 0], "type" => $MOVE_ENUM), MoveStruct->new("mov" => [ 1,-1], "type" => $MOVE_ENUM) ], - $MG_SY => [ + $MG_SY => [ MoveStruct->new("mov" => [-4, 4], "type" => $MOVE_ENUM), MoveStruct->new("mov" => [-3, 3], "type" => $MOVE_ENUM), MoveStruct->new("mov" => [-3, 2], "type" => $MOVE_ENUM), @@ -600,7 +602,7 @@ sub shade_move($$){ $_->{"type"} ] } grep { - ($_->{"type"} && $en) eq $en + ($_->{"type"} & $en) eq $_->{"type"} } @{$MOVE{$c1}}; for my $mv (@mv1){ @@ -623,12 +625,12 @@ binmode(STDOUT, ":utf8"); $AXIS_RV{$_} }(1...11); -# my $m1 = "F7"; -my $m1 = "A1"; +my $m1 = "F7"; +# my $m1 = "A1"; my $c1 = $MG_QS; $board{$m1} = $P1.$DIV.$c1; -shade_move($m1, $MOVE_ENUM); +shade_move($m1, $MOVBLOCK_ENUM); disp_board();