line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Games::Cards::Pair::Params; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$Games::Cards::Pair::Params::VERSION = '0.18'; |
4
|
|
|
|
|
|
|
$Games::Cards::Pair::Params::AUTHORITY = 'cpan:MANWAR'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Games::Cards::Pair::Params - Placeholder for parameters for Games::Cards::Pair. |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Version 0.18 |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
5
|
|
|
5
|
|
98
|
use 5.006; |
|
5
|
|
|
|
|
23
|
|
17
|
5
|
|
|
5
|
|
24
|
use strict; use warnings; |
|
5
|
|
|
5
|
|
8
|
|
|
5
|
|
|
|
|
109
|
|
|
5
|
|
|
|
|
23
|
|
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
169
|
|
18
|
5
|
|
|
5
|
|
24
|
use Data::Dumper; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
327
|
|
19
|
|
|
|
|
|
|
|
20
|
5
|
|
|
5
|
|
27
|
use Type::Library -base, -declare => qw(ZeroOrOne Suit Value Card Cards); |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
32
|
|
21
|
5
|
|
|
5
|
|
3934
|
use Types::Standard qw(Str InstanceOf ArrayRef); |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
28
|
|
22
|
5
|
|
|
5
|
|
6578
|
use Type::Utils; |
|
5
|
|
|
|
|
20703
|
|
|
5
|
|
|
|
|
44
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my $SUITS = { 'C' => 1, 'D' => 1, 'H' => 1, 'S' => 1 }; |
25
|
|
|
|
|
|
|
my $VALUES = { '2' => 1, '3' => 1, '4' => 1, '5' => 1, |
26
|
|
|
|
|
|
|
'6' => 1, '7' => 1, '8' => 1, '9' => 1, |
27
|
|
|
|
|
|
|
'10'=> 1, 'A' => 1, 'J' => 1, 'Q' => 1, |
28
|
|
|
|
|
|
|
'K' => 1, 'Joker' => 1 }; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
declare 'ZeroOrOne', |
31
|
|
|
|
|
|
|
as Str, |
32
|
|
|
|
|
|
|
where { /^[0|1]$/ }, |
33
|
|
|
|
|
|
|
message { "ERROR: Only 0 or 1 allowed." }; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
declare 'Suit', |
36
|
|
|
|
|
|
|
as Str, |
37
|
|
|
|
|
|
|
where { exists $SUITS->{ucfirst(lc($_[0]))} }, |
38
|
|
|
|
|
|
|
message { "isa check for 'suit' failed." }; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
declare 'Value', |
41
|
|
|
|
|
|
|
as Str, |
42
|
|
|
|
|
|
|
where { exists $VALUES->{ucfirst(lc($_[0]))} }, |
43
|
|
|
|
|
|
|
message { "isa check for 'value' failed." }; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
declare 'Card', |
46
|
|
|
|
|
|
|
as InstanceOf['Games::Cards::Pair::Card']; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
declare 'Cards', |
49
|
|
|
|
|
|
|
as ArrayRef[Card], |
50
|
|
|
|
|
|
|
message { "isa check for 'cards' failed." }; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 AUTHOR |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Mohammad S Anwar, C<< >> |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 REPOSITORY |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
L |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 BUGS |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, |
63
|
|
|
|
|
|
|
or through the web interface at L. |
64
|
|
|
|
|
|
|
I will be notified and then you'll automatically be notified of progress on your |
65
|
|
|
|
|
|
|
bug as I make changes. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 SUPPORT |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
perldoc Games::Cards::Pair::Params |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
You can also look for information at: |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=over 4 |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
L |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
L |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=item * CPAN Ratings |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
L |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=item * Search CPAN |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
L |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=back |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Copyright (C) 2012 - 2016 Mohammad S Anwar. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
This program is free software; you can redistribute it and / or modify it under |
100
|
|
|
|
|
|
|
the terms of the the Artistic License (2.0). You may obtain a copy of the full |
101
|
|
|
|
|
|
|
license at: |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
L |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Any use, modification, and distribution of the Standard or Modified Versions is |
106
|
|
|
|
|
|
|
governed by this Artistic License.By using, modifying or distributing the Package, |
107
|
|
|
|
|
|
|
you accept this license. Do not use, modify, or distribute the Package, if you do |
108
|
|
|
|
|
|
|
not accept this license. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
If your Modified Version has been derived from a Modified Version made by someone |
111
|
|
|
|
|
|
|
other than you,you are nevertheless required to ensure that your Modified Version |
112
|
|
|
|
|
|
|
complies with the requirements of this license. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
This license does not grant you the right to use any trademark, service mark, |
115
|
|
|
|
|
|
|
tradename, or logo of the Copyright Holder. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
This license includes the non-exclusive, worldwide, free-of-charge patent license |
118
|
|
|
|
|
|
|
to make, have made, use, offer to sell, sell, import and otherwise transfer the |
119
|
|
|
|
|
|
|
Package with respect to any patent claims licensable by the Copyright Holder that |
120
|
|
|
|
|
|
|
are necessarily infringed by the Package. If you institute patent litigation |
121
|
|
|
|
|
|
|
(including a cross-claim or counterclaim) against any party alleging that the |
122
|
|
|
|
|
|
|
Package constitutes direct or contributory patent infringement,then this Artistic |
123
|
|
|
|
|
|
|
License to you shall terminate on the date that such litigation is filed. |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND |
126
|
|
|
|
|
|
|
CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED |
127
|
|
|
|
|
|
|
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR |
128
|
|
|
|
|
|
|
NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS |
129
|
|
|
|
|
|
|
REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, |
130
|
|
|
|
|
|
|
INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE |
131
|
|
|
|
|
|
|
OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=cut |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
1; # End of Games::Cards::Pair::Params |