diff --git a/LPST.pm b/LPST.pm index dede251..45cd5ac 100644 --- a/LPST.pm +++ b/LPST.pm @@ -82,6 +82,11 @@ my @MG_PI = ( my $P1 = "P1"; my $P2 = "P2"; +my %HAND = ( + $P1 => [], + $P2 => [] + ); + my $DIV = ":"; my %AXIS = ( @@ -718,12 +723,15 @@ sub get_block_cell($){ } sub draw($$){ - my ($self, $s0) = (shift, shift); + my ($self, $s0, $apt) = (shift, shift, shift); my $i = 0; for my $s1 (uniq( [split(/ /, $s0)] )){ $i++; - die "invalid card - $s1" unless grep { $_ =~ /^$s1$/ } @MG_PI; + die "invalid card - $s1" unless grep { + $_ =~ /^$s1$/ + } @MG_PI; + $HAND{$P1} = $s1; } die "draw() $s0 - hand size less than $HAND_SIZE. Possible duplicate card?" if $i < $HAND_SIZE; } diff --git a/ntvl.pl b/ntvl.pl index f96aff6..b8d1cba 100644 --- a/ntvl.pl +++ b/ntvl.pl @@ -39,7 +39,7 @@ sub is_draw($){ sub draw($$$){ my ($b, $s0, $apl) = (shift, shift, shift); die "invalid draw() syntax $s0" unless $s0 =~ /^([A-Za-z]{1,2} ){4}[A-Za-z]{1,2}$/; - $b->draw($s0); + $b->draw($s0, $apl); } sub mt2($$$$){