LPST.pm - updates player hand ntvl.pl - updated test cases
This commit is contained in:
parent
c057039549
commit
7f92f1f269
12
LPST.pm
12
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user