line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Freecell::Deal::MS; |
2
|
|
|
|
|
|
|
$Freecell::Deal::MS::VERSION = '0.2.0'; |
3
|
1
|
|
|
1
|
|
71419
|
use strict; |
|
1
|
|
|
|
|
12
|
|
|
1
|
|
|
|
|
29
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
555
|
use Math::RNG::Microsoft::FCPro (); |
|
1
|
|
|
|
|
65664
|
|
|
1
|
|
|
|
|
44
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use Class::XSAccessor { |
9
|
1
|
|
|
|
|
7
|
constructor => 'new', |
10
|
|
|
|
|
|
|
accessors => [qw(deal)], |
11
|
1
|
|
|
1
|
|
504
|
}; |
|
1
|
|
|
|
|
2439
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub as_str |
14
|
|
|
|
|
|
|
{ |
15
|
2
|
|
|
2
|
1
|
1737
|
my ($self) = @_; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my @cards = ( |
18
|
|
|
|
|
|
|
map { |
19
|
2
|
|
|
|
|
16
|
my $s = $_; |
|
26
|
|
|
|
|
36
|
|
20
|
26
|
|
|
|
|
40
|
map { $s . $_ } qw/C D H S/; |
|
104
|
|
|
|
|
199
|
|
21
|
|
|
|
|
|
|
} ( 'A', ( 2 .. 9 ), 'T', 'J', 'Q', 'K' ) |
22
|
|
|
|
|
|
|
); |
23
|
2
|
|
|
|
|
18
|
Math::RNG::Microsoft::FCPro->new( seed => scalar( $self->deal ) ) |
24
|
|
|
|
|
|
|
->shuffle( \@cards ); |
25
|
2
|
|
|
|
|
126187
|
my @lines = ( map { [ ':', ] } 0 .. 7 ); |
|
16
|
|
|
|
|
38
|
|
26
|
2
|
|
|
|
|
5
|
my $i = 0; |
27
|
2
|
|
|
|
|
10
|
while (@cards) |
28
|
|
|
|
|
|
|
{ |
29
|
104
|
|
|
|
|
127
|
push @{ $lines[$i] }, pop(@cards); |
|
104
|
|
|
|
|
167
|
|
30
|
104
|
|
|
|
|
194
|
$i = ( ( $i + 1 ) & 7 ); |
31
|
|
|
|
|
|
|
} |
32
|
2
|
|
|
|
|
6
|
my $str = join "", map { "@$_\n" } @lines; |
|
16
|
|
|
|
|
47
|
|
33
|
2
|
|
|
|
|
22
|
return $str; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |