LPST.pm - refactored into a class ntvl.pl - created a test board
This commit is contained in:
parent
bd10b2ae4d
commit
e3c07ef59f
31
LPST.pm
31
LPST.pm
@ -107,7 +107,7 @@ sub new {
|
||||
return bless $self, $class;
|
||||
}
|
||||
|
||||
package main;
|
||||
package LPST;
|
||||
|
||||
#
|
||||
# /--\ +1
|
||||
@ -704,11 +704,9 @@ sub get_block_cell($){
|
||||
} keys(%board);
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Main starts here!
|
||||
#==================================================
|
||||
binmode(STDOUT, ":utf8");
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $self = { @_ };
|
||||
|
||||
# Creates a hash of the the form
|
||||
# $board{cell_notation} = piece_enum
|
||||
@ -722,19 +720,14 @@ binmode(STDOUT, ":utf8");
|
||||
$AXIS_RV{$_}
|
||||
}(1...11);
|
||||
|
||||
# my $m1 = "F7";
|
||||
my $m1 = "C10";
|
||||
my $m2 = "B3";
|
||||
my $c1 = $MG_SY;
|
||||
my $c2 = $MG_A;
|
||||
|
||||
$board{$m1} = $P1.$DIV.$c1;
|
||||
$board{$m2} = $P2.$DIV.$c2;
|
||||
|
||||
for my $el (get_block_cell($P1)){
|
||||
printf("%s\n", $el);
|
||||
return bless $self, $class;
|
||||
}
|
||||
|
||||
shade_all_mvmt($P1);
|
||||
disp_board();
|
||||
return 1;
|
||||
|
||||
# Is this needed?
|
||||
# binmode(STDOUT, ":utf8");
|
||||
|
||||
|
||||
|
||||
|
||||
|
32
ntvl.pl
Normal file
32
ntvl.pl
Normal file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
package main;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
use lib './';
|
||||
use LPST;
|
||||
|
||||
my $b;
|
||||
|
||||
# my $m1 = "F7";
|
||||
# my $m1 = "C10";
|
||||
# my $m2 = "B3";
|
||||
# my $c1 = $MG_SY;
|
||||
# my $c2 = $MG_A;
|
||||
|
||||
# $board{$m1} = $P1.$DIV.$c1;
|
||||
# $board{$m2} = $P2.$DIV.$c2;
|
||||
|
||||
# for my $el (get_block_cell($P1)){
|
||||
# printf("%s\n", $el);
|
||||
# }
|
||||
|
||||
# shade_all_mvmt($P1);
|
||||
# disp_board();
|
||||
|
||||
$b = LPST->new();
|
||||
|
||||
$b->shade_all_mvmt("P1");
|
||||
$b->disp_board();
|
Loading…
Reference in New Issue
Block a user