MNU.pm/NTVL.pm - factored in to packages test.pl - moved test cases to test.pl

This commit is contained in:
gashapwn 2021-04-11 23:12:37 +00:00
parent 39c477aae5
commit 11a2806dbd
3 changed files with 42 additions and 28 deletions

4
MNU.pm
View File

@ -3,6 +3,10 @@
use warnings;
use strict;
use lib "./";
use NTVL;
use LPST;
package MNU;
sub prompt(){

33
NTVL.pm
View File

@ -17,6 +17,8 @@ my $SACRIFICE = 0b00001000;
my $DRAW = 0b00010000;
my $FT = 0b00100001;
package NTVL;
sub is_summon($){
return $_[0] =~ /\*/ ? $SUMMON : 0;
}
@ -92,8 +94,8 @@ sub f2($$$){
return LPST->P1;
}
sub f1($$){
my ($b, $ns0) = (shift, shift);
sub f1($$$){
my ($clas, $b, $ns0) = (shift, shift, shift);
my $apl;
my $tc;
@ -110,29 +112,4 @@ sub f1($$){
}
}
my $ns0;
$ns0 = "";
$ns0 .= "A I Im Au H\n";
$ns0 .= "A S Im Rc It\n";
$ns0 .= "Aa1*, Ab1*, Ac1*, Ad1*, Ae1*, Qf1*, Ag1*, Ah1*, Ai1*, Aj1*, Ak1*, Ad2*, Ai2*, Aj2*, Ak2*, Ad3*\n";
$ns0 .= "Aa11*, Ab11*, Ac11*, Ad11*, Ae11*, Qf11*\n";
$ns0 .= "Aa1a2\n";
$ns0 .= "Qf11g11\n";
$ns0 .= "Aa2a3\n";
$ns0 .= "Qg11f10\n";
$ns0 .= "Aa3a4\n";
$ns0 .= "Qf10e10\n";
$ns0 .= "Aa4a5\n";
$ns0 .= "Qe10d10\n";
$ns0 .= "Aa5a6\n";
# $ns0 .= "Qd10e9\n";
my $b;
$b = LPST->new();
f1($b, $ns0);
$b->shade_all_p2_mvmt();
$b->disp_board();
return 1;

33
test.pl Normal file
View File

@ -0,0 +1,33 @@
#!/usr/bin/perl
use warnings;
use strict;
use lib './';
use NTVL;
use LPST;
my $ns0;
$ns0 = "";
$ns0 .= "A I Im Au H\n";
$ns0 .= "A S Im Rc It\n";
$ns0 .= "Aa1*, Ab1*, Ac1*, Ad1*, Ae1*, Qf1*, Ag1*, Ah1*, Ai1*, Aj1*, Ak1*, Ad2*, Ai2*, Aj2*, Ak2*, Ad3*\n";
$ns0 .= "Aa11*, Ab11*, Ac11*, Ad11*, Ae11*, Qf11*\n";
$ns0 .= "Aa1a2\n";
$ns0 .= "Qf11g11\n";
$ns0 .= "Aa2a3\n";
$ns0 .= "Qg11f10\n";
$ns0 .= "Aa3a4\n";
$ns0 .= "Qf10e10\n";
$ns0 .= "Aa4a5\n";
$ns0 .= "Qe10d10\n";
$ns0 .= "Aa5a6\n";
# $ns0 .= "Qd10e9\n";
$b = LPST->new();
NTVL->f1($b, $ns0);
$b->shade_all_p2_mvmt();
$b->disp_board();