From 11a2806dbdade64b6294a1612ff7308f2ad2e06a Mon Sep 17 00:00:00 2001 From: gashapwn Date: Sun, 11 Apr 2021 23:12:37 +0000 Subject: [PATCH] MNU.pm/NTVL.pm - factored in to packages test.pl - moved test cases to test.pl --- MNU.pm | 4 ++++ NTVL.pm | 33 +++++---------------------------- test.pl | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 28 deletions(-) create mode 100644 test.pl diff --git a/MNU.pm b/MNU.pm index 3a0b1b9..87f4393 100644 --- a/MNU.pm +++ b/MNU.pm @@ -3,6 +3,10 @@ use warnings; use strict; +use lib "./"; +use NTVL; +use LPST; + package MNU; sub prompt(){ diff --git a/NTVL.pm b/NTVL.pm index f8d16b0..0a7a44a 100644 --- a/NTVL.pm +++ b/NTVL.pm @@ -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; diff --git a/test.pl b/test.pl new file mode 100644 index 0000000..387015e --- /dev/null +++ b/test.pl @@ -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();