Mercurial > boosterpack
comparison index.pl @ 8:8c6d2ce90677 boosterpack
[svn r11] saving for transference to cd
author | rlm |
---|---|
date | Fri, 19 Mar 2010 07:28:10 -0400 |
parents | 4c495190076f |
children |
comparison
equal
deleted
inserted
replaced
7:4c495190076f | 8:8c6d2ce90677 |
---|---|
1 #!C:/strawberry/perl/bin/perl.exe | 1 #!/usr/bin/perl |
2 | 2 |
3 | |
4 | |
3 use List::Util qw(first max maxstr min minstr reduce shuffle sum); | 5 use List::Util qw(first max maxstr min minstr reduce shuffle sum); |
4 use Storable; | 6 use Storable; |
5 use CGI::Ajax; | 7 use CGI::Ajax; |
6 use CGI; | 8 use CGI; |
7 use Rule; | 9 use Rule; |
12 | 14 |
13 | 15 |
14 my $refstruct = retrieve 'CARD.perl'; | 16 my $refstruct = retrieve 'CARD.perl'; |
15 my @pokes = @$refstruct; | 17 my @pokes = @$refstruct; |
16 | 18 |
17 | 19 open ERR, ">./error.log"; |
18 | 20 print ERR "hi"; |
19 | 21 |
20 | 22 |
21 my %hash = ( 'gen_pack' => \&gen_pack, 'change_rules' => \&change_rules); | 23 my %hash = ( 'gen_pack' => \&gen_pack, 'change_rules' => \&change_rules); |
22 | 24 |
23 | 25 |
56 | 58 |
57 | 59 |
58 | 60 |
59 sub gen_pack | 61 sub gen_pack |
60 { | 62 { |
63 | |
64 | |
65 | |
66 | |
61 sub tag_analyze | 67 sub tag_analyze |
62 { | 68 { |
63 | 69 |
64 | 70 |
65 | 71 |
66 my @sets = $currentRule -> getSets(); | 72 my @sets = $currentRule -> getSets(); |
67 #print ERR @sets; | 73 print ERR @sets; |
68 | 74 |
69 my $card = shift; | 75 my $card = shift; |
70 | 76 |
71 #print ERR $card->getPix(); | 77 #print ERR $card->getPix(); |
72 #print ERR "\n"; | 78 #print ERR "\n"; |
82 my %mapRules = %$mapRules; | 88 my %mapRules = %$mapRules; |
83 | 89 |
84 | 90 |
85 | 91 |
86 | 92 |
87 #print ERR "@pokes"; | 93 print ERR "@pokes"; |
88 @reduced = filter(\&tag_analyze, @pokes); | 94 @reduced = filter(\&tag_analyze, @pokes); |
89 @reduced = shuffle(@reduced); | 95 @reduced = shuffle(@reduced); |
90 | 96 |
91 my @final_list = (); | 97 my @final_list = (); |
92 my $rnum = $mapRules{"Rare"}; | 98 my $rnum = $mapRules{"Rare"}; |
122 | 128 |
123 } | 129 } |
124 | 130 |
125 #print $rob; | 131 #print $rob; |
126 | 132 |
127 #print ERR @reduced; | 133 print ERR @reduced; |
128 #print ERR $rob; | 134 print ERR $rob; |
129 #print $rob; | 135 print $rob; |
130 return $rob; | 136 return $rob; |
131 #close ERR; | 137 close ERR; |
132 | 138 |
133 | 139 |
134 }; | 140 }; |
135 | 141 |
136 | 142 |
145 }; | 151 }; |
146 | 152 |
147 #print "done"; | 153 #print "done"; |
148 | 154 |
149 #print &change_rules("Fossil"); | 155 #print &change_rules("Fossil"); |
150 #print &gen_pack; | 156 print ERR &gen_pack; |