changeset 2:d7dd496a4fa6 boosterpack

[svn r4] actual functionality!
author robert
date Tue, 08 Sep 2009 02:45:26 -0400
parents c702488ef795
children 2e849c856026
files CARD.perl PokeScrape.pl Rule.pm error.txt filter.pl filter.pm index.html index.pl pjx_radio.pl rlm/booster.prefs rulegen.pl ruletest.pl
diffstat 12 files changed, 252 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
     1.1 Binary file CARD.perl has changed
     2.1 --- a/PokeScrape.pl	Mon Aug 31 14:53:15 2009 -0400
     2.2 +++ b/PokeScrape.pl	Tue Sep 08 02:45:26 2009 -0400
     2.3 @@ -43,10 +43,11 @@
     2.4  	
     2.5  	if ($line =~ m/^<td/)
     2.6  	{
     2.7 -		print $numTag," ",$nameTag, "\n";
     2.8 +		print $numTag," ",$nameTag;
     2.9  		$tempCard = Card->new();
    2.10  		$tempCard->addTags($typeTag,$numTag,$nameTag,$setTag,$rarityTag);
    2.11  		$tempCard->setPix($pix);
    2.12 +		print " $setTag \n";
    2.13  		push @allcards,$tempCard;
    2.14  		
    2.15  		
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/Rule.pm	Tue Sep 08 02:45:26 2009 -0400
     3.3 @@ -0,0 +1,32 @@
     3.4 +package Rule;
     3.5 +use List::Util qw(first max maxstr min minstr reduce shuffle sum);
     3.6 +
     3.7 +sub new
     3.8 +{
     3.9 +	my $class = shift;
    3.10 +	
    3.11 +	my $hashREF = 
    3.12 +	{
    3.13 +		_rarity_map => {"Rare" , 1 , "Uncommon" , 3 , "Common" , 6},
    3.14 +		_sets  => ("Base Set")
    3.15 +		
    3.16 +		
    3.17 +		
    3.18 +	};
    3.19 +	
    3.20 +	$objectREF = bless($hashREF, $class);
    3.21 +	
    3.22 +	return $objectREF;	
    3.23 +	
    3.24 +}
    3.25 +
    3.26 +
    3.27 +sub getRarityMap { return @_[0]->{'_rarity_map'}; };
    3.28 +sub getSets { return @_[0]->{'_sets'}; }
    3.29 +
    3.30 +
    3.31 +sub setRarityMap { $_[0]->{_rarity_map} = $_[1]; }
    3.32 +sub setSets { $_[0]->{_sets} = $_[1]; }
    3.33 +
    3.34 +
    3.35 +1; 
    3.36 \ No newline at end of file
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/error.txt	Tue Sep 08 02:45:26 2009 -0400
     4.3 @@ -0,0 +1,1 @@
     4.4 +Card=HASH(0x9aecc4) Card=HASH(0x99132c) Card=HASH(0x99123c) Card=HASH(0x99119c) Card=HASH(0x9910fc) Card=HASH(0x99105c) Card=HASH(0x990fbc) Card=HASH(0x77160c) Card=HASH(0x77156c) Card=HASH(0x7714cc) Card=HASH(0x9aefd4) Card=HASH(0x9aef34) Card=HASH(0x9aee94) Card=HASH(0x9aedf4) Card=HASH(0x9aed54) Card=HASH(0x9ff66c) Card=HASH(0x9f3dfc) Card=HASH(0x9f3e9c) Card=HASH(0x9f3f3c) Card=HASH(0x9e20c4) Card=HASH(0x9e2164) Card=HASH(0x9e2204) Card=HASH(0x9e22a4) Card=HASH(0x9e2344) Card=HASH(0x9e23e4) Card=HASH(0x9e2484) Card=HASH(0x9e2524) Card=HASH(0x9e25c4) Card=HASH(0x9e2664) Card=HASH(0x9e2704) Card=HASH(0x9e27a4) Card=HASH(0x9e2844) Card=HASH(0x9e28e4) Card=HASH(0x9e2984) Card=HASH(0x9e2a24) Card=HASH(0x9e2ac4) Card=HASH(0x9e2b64) Card=HASH(0x9e2c04) Card=HASH(0x9e2ca4) Card=HASH(0x9e2d44) Card=HASH(0x9e2de4) Card=HASH(0x9e2e84) Card=HASH(0x9e2f24) Card=HASH(0x9e2fc4) Card=HASH(0x9f7f9c) Card=HASH(0x9f803c) Card=HASH(0x9f80dc) Card=HASH(0x9f817c) Card=HASH(0x9f821c) Card=HASH(0x9f82bc) Card=HASH(0x9e306c) Card=HASH(0x9e310c) Card=HASH(0x9e31ac) Card=HASH(0x9e324c) Card=HASH(0x9e32ec) Card=HASH(0x9e338c) Card=HASH(0x9e342c) Card=HASH(0x9e34cc) Card=HASH(0x9e356c) Card=HASH(0x9e360c) Card=HASH(0x9e36ac) Card=HASH(0x9e374c) Card=HASH(0x9e37ec) Card=HASH(0x9e388c) Card=HASH(0x9e392c) Card=HASH(0x9e39cc) Card=HASH(0x9e3a6c) Card=HASH(0x9e3b0c) Card=HASH(0x9e3bac) Card=HASH(0x9e3c4c) Card=HASH(0x9e3cec) Card=HASH(0x9e3d8c) Card=HASH(0x9e3e2c) Card=HASH(0x9e3ecc) Card=HASH(0x9e3f6c) Card=HASH(0x9e400c) Card=HASH(0x9f00a4) Card=HASH(0x9f0144) Card=HASH(0x9f01e4) Card=HASH(0x9f0284) Card=HASH(0x9f0324) Card=HASH(0x9f03c4) Card=HASH(0x9f0464) Card=HASH(0x9f0504) Card=HASH(0x9f05a4) Card=HASH(0x9f0644) Card=HASH(0x9f06e4) Card=HASH(0x9f0784) Card=HASH(0x9e779c) Card=HASH(0x9e783c) Card=HASH(0x9e78dc) Card=HASH(0x9e797c) Card=HASH(0x9e7a1c) Card=HASH(0x9e7abc) Card=HASH(0x9e7b5c) Card=HASH(0x9e7bfc) Card=HASH(0x9e7c9c) Card=HASH(0x9e7d3c) Card=HASH(0x9e7dcc) Card=HASH(0x9e7e5c) Card=HASH(0x9e7eec) Card=HASH(0x9e7f7c) Card=HASH(0x9e800c) Card=HASH(0x9e809c) Card=HASH(0x9e813c) Card=HASH(0x9e81dc) Card=HASH(0x9e827c) Card=HASH(0x9e831c) Card=HASH(0x9e83bc) Card=HASH(0x9e845c) Card=HASH(0x9e84fc) Card=HASH(0x9e859c) Card=HASH(0x9e863c) Card=HASH(0x9e86dc) Card=HASH(0x9e4074) Card=HASH(0x9e4114) Card=HASH(0x9e41b4) Card=HASH(0x9e4254) Card=HASH(0x9e42f4) Card=HASH(0x9e4394) Card=HASH(0x9e4434) Card=HASH(0x9e44d4) Card=HASH(0x9e4574) Card=HASH(0x9e4614) Card=HASH(0x9e46b4) Card=HASH(0x9e4754) Card=HASH(0x9e47f4) Card=HASH(0x9e4894) Card=HASH(0x9e4934) Card=HASH(0x9e49d4) Card=HASH(0x9e4a74) Card=HASH(0x9e4b14) Card=HASH(0x9e4bb4) Card=HASH(0x9e4c54) Card=HASH(0x9e4cf4) Card=HASH(0x9e4d94) Card=HASH(0x9e4e34) Card=HASH(0x9e4ed4) Card=HASH(0x9e4f74) Card=HASH(0x9e5014) Card=HASH(0xa02bf4) Card=HASH(0xa02c94) Card=HASH(0xa02d34) Card=HASH(0xa02dd4) Card=HASH(0xa02e74) Card=HASH(0xa02f14) Card=HASH(0xa02fb4) Card=HASH(0xa03054) Card=HASH(0xa030f4) Card=HASH(0xa03194) Card=HASH(0xa03234) Card=HASH(0xa032d4) Card=HASH(0xa03374) Card=HASH(0xa03414) Card=HASH(0xa034b4) Card=HASH(0xa03554) Card=HASH(0xa035f4) Card=HASH(0xa03694) Card=HASH(0xa03734) Card=HASH(0xa037d4) Card=HASH(0xa03874) Card=HASH(0xa03914) Card=HASH(0xa039b4) Card=HASH(0xa03a54) Card=HASH(0xa03af4) Card=HASH(0xa06d4c) Card=HASH(0xa06dec) Card=HASH(0xa06e8c) Card=HASH(0xa06f2c) Card=HASH(0xa06fcc) Card=HASH(0xa0706c) Card=HASH(0xa0710c) Card=HASH(0xa071ac) Card=HASH(0xa0724c) Card=HASH(0xa072ec) Card=HASH(0xa0738c) Card=HASH(0xa0742c) Card=HASH(0xa074cc) Card=HASH(0xa0756c) Card=HASH(0xa0760c) Card=HASH(0xa076ac) Card=HASH(0xa0774c) Card=HASH(0xa077ec) Card=HASH(0xa0788c) Card=HASH(0xa0792c) Card=HASH(0xa079cc) Card=HASH(0xa07a6c) Card=HASH(0xa07b0c) Card=HASH(0xa07bac) Card=HASH(0xa07c4c) Card=HASH(0xa09c5c) Card=HASH(0xa09cfc) Card=HASH(0xa09d9c) Card=HASH(0xa09e3c) Card=HASH(0xa09edc) Card=HASH(0xa09f7c) Card=HASH(0xa0a01c) Card=HASH(0xa0a0bc) Card=HASH(0xa0a15c) Card=HASH(0xa0a1fc) Card=HASH(0xa0a29c) Card=HASH(0xa0a33c) Card=HASH(0xa0a3dc) Card=HASH(0xa0a47c) Card=HASH(0xa0a51c) Card=HASH(0xa0a5bc) Card=HASH(0xa0a65c) Card=HASH(0xa0a6fc) Card=HASH(0xa0a79c) Card=HASH(0xa0a83c) Card=HASH(0xa0a8dc) Card=HASH(0xa0a97c) Card=HASH(0xa0aa1c) Card=HASH(0xa0aabc) Card=HASH(0xa0ab5c) Card=HASH(0xa0abfc) Card=HASH(0x9eacf4) Card=HASH(0x9ead94) Card=HASH(0x9eae34) Card=HASH(0x9eaed4) Card=HASH(0x9eaf74) Card=HASH(0x9eb014) Card=HASH(0x9eb0b4) Card=HASH(0x9eb154) Card=HASH(0x9eb1f4) Card=HASH(0x9eb294) Card=HASH(0x9eb334) Card=HASH(0x9eb3d4) Card=HASH(0x9eb474) Card=HASH(0x9eb514) Card=HASH(0x9eb5b4) Card=HASH(0x9eb654) Card=HASH(0x9eb6f4) Card=HASH(0x9eb794) Card=HASH(0x9eb834) Card=HASH(0x9eb8d4) Card=HASH(0x9eb974) Card=HASH(0x9eba14) Card=HASH(0x9ebab4) Card=HASH(0x9ebb54) Card=HASH(0x9ebbf4) Card=HASH(0x9ebc94) Card=HASH(0x9ebd34) Card=HASH(0x9ebdd4) Card=HASH(0x9ebe74) Card=HASH(0x9ebf14) Card=HASH(0x9ebfb4) Card=HASH(0x9ec054) Card=HASH(0x9ec0f4) Card=HASH(0x9ec194) Card=HASH(0x9ec234) Card=HASH(0x9ec2d4) Card=HASH(0x9ec374) Card=HASH(0x9ec414) Card=HASH(0x9ec4b4) Card=HASH(0x9ec554) Card=HASH(0x9ec5f4) Card=HASH(0x9ec694) Card=HASH(0x9ec734) Card=HASH(0x9ec7d4) Card=HASH(0x9ec874) Card=HASH(0x9ec914) Card=HASH(0x9ec9b4) Card=HASH(0x9eca54) Card=HASH(0x9ecaf4) Card=HASH(0x9ecb94) Card=HASH(0x9ecc34) Card=HASH(0xa18f1c) Card=HASH(0xa18fbc) Card=HASH(0xa1905c) Card=HASH(0xa190fc) Card=HASH(0xa1919c) Card=HASH(0xa1923c) Card=HASH(0xa192dc) Card=HASH(0xa1937c) Card=HASH(0xa1941c) Card=HASH(0xa194bc) Card=HASH(0xa1955c) Card=HASH(0xa195fc) Card=HASH(0xa1969c) Card=HASH(0xa1973c) Card=HASH(0xa197dc) Card=HASH(0xa1987c) Card=HASH(0xa1991c) Card=HASH(0xa199bc) Card=HASH(0xa19a5c) Card=HASH(0xa19afc) Card=HASH(0xa19b9c) Card=HASH(0xa19c3c) Card=HASH(0xa19cdc) Card=HASH(0xa19d7c) Card=HASH(0xa19e1c) Card=HASH(0xa1ce24) Card=HASH(0xa1cec4) Card=HASH(0xa1cf64) Card=HASH(0xa1d004) Card=HASH(0xa1d0a4) Card=HASH(0xa1d144) Card=HASH(0xa1d1e4) Card=HASH(0xa1d284) Card=HASH(0xa1d324) Card=HASH(0xa1d3c4) Card=HASH(0xa1d464) Card=HASH(0xa1d504) Card=HASH(0xa1d5a4) Card=HASH(0xa1d644) Card=HASH(0xa1d6e4) Card=HASH(0xa1d784) Card=HASH(0xa1d824) Card=HASH(0xa1d8c4) Card=HASH(0xa1d964) Card=HASH(0xa1da04) Card=HASH(0xa1daa4) Card=HASH(0xa1db44) Card=HASH(0xa1dbe4) Card=HASH(0xa1dc84) Card=HASH(0xa1dd24) Card=HASH(0xa1ddc4) Card=HASH(0xa21f44) Card=HASH(0xa21fe4) Card=HASH(0xa22084) Card=HASH(0xa22124) Card=HASH(0xa221c4) Card=HASH(0xa22264) Card=HASH(0xa22304) Card=HASH(0xa223a4) Card=HASH(0xa22444) Card=HASH(0xa224e4) Card=HASH(0xa22584) Card=HASH(0xa22624) Card=HASH(0xa226c4) Card=HASH(0xa22764) Card=HASH(0xa22804) Card=HASH(0xa228a4) Card=HASH(0xa22944) Card=HASH(0xa229e4) Card=HASH(0xa22a84) Card=HASH(0xa22b24) Card=HASH(0xa22bc4) Card=HASH(0xa22c64) Card=HASH(0xa22d04) Card=HASH(0xa22da4) Card=HASH(0xa22e44) Card=HASH(0xa2521c) Card=HASH(0xa252bc) Card=HASH(0xa2535c) Card=HASH(0xa253fc) Card=HASH(0xa2549c) Card=HASH(0xa2553c) Card=HASH(0xa255dc) Card=HASH(0xa2567c) Card=HASH(0xa2571c) Card=HASH(0xa257bc) Card=HASH(0xa2585c) Card=HASH(0xa258fc) Card=HASH(0xa2599c) Card=HASH(0xa25a3c) Card=HASH(0xa25adc) Card=HASH(0xa25b7c) Card=HASH(0xa25c1c) Card=HASH(0xa25cbc) Card=HASH(0xa25d5c) Card=HASH(0xa25dfc) Card=HASH(0xa25e9c) Card=HASH(0xa25f3c) Card=HASH(0xa25fdc) Card=HASH(0xa2607c) Card=HASH(0xa2611c) Card=HASH(0xa2a58c) Card=HASH(0xa2a62c) Card=HASH(0xa2a6cc) Card=HASH(0xa2a76c) Card=HASH(0xa2a80c) Card=HASH(0xa2a8ac) Card=HASH(0xa2a94c) Card=HASH(0xa2a9ec) Card=HASH(0xa2aa8c) Card=HASH(0xa2ab2c) Card=HASH(0xa2abcc) Card=HASH(0xa2ac6c) Card=HASH(0xa2ad0c) Card=HASH(0xa2adac) Card=HASH(0xa2ae4c) Card=HASH(0xa2aeec) Card=HASH(0xa2af8c) Card=HASH(0xa2b02c) Card=HASH(0xa2b0cc) Card=HASH(0xa2b16c) Card=HASH(0xa2b20c) Card=HASH(0xa2b2ac) Card=HASH(0xa2b34c) Card=HASH(0xa2b3ec) Card=HASH(0xa2b48c) Card=HASH(0xa2b52c) Card=HASH(0xa2d66c) Card=HASH(0xa2d70c) Card=HASH(0xa2d7ac) Card=HASH(0xa2d84c) Card=HASH(0xa2d8ec) Card=HASH(0xa2d98c) Card=HASH(0xa2da2c) Card=HASH(0xa2dacc) Card=HASH(0xa2db6c) Card=HASH(0xa2dc0c) Card=HASH(0xa2dcac) Card=HASH(0xa2dd4c) Card=HASH(0xa2ddec) Card=HASH(0xa2de8c) Card=HASH(0xa2df2c) Card=HASH(0xa2dfcc) Card=HASH(0xa2e06c) Card=HASH(0xa2e10c) Card=HASH(0xa2e1ac) Card=HASH(0xa2e24c) Card=HASH(0xa2e2ec) Card=HASH(0xa2e38c) Card=HASH(0xa2e42c) Card=HASH(0xa2e4cc) Card=HASH(0xa2e56c) Card=HASH(0xa0dea4) Card=HASH(0xa0df44) Card=HASH(0xa0dfe4) Card=HASH(0xa0e084) Card=HASH(0xa0e124) Card=HASH(0xa0e1c4) Card=HASH(0xa0e264) Card=HASH(0xa0e304) Card=HASH(0xa0e3a4) Card=HASH(0xa0e444) Card=HASH(0xa0e4e4) Card=HASH(0xa0e584) Card=HASH(0xa0e624) Card=HASH(0xa0e6c4) Card=HASH(0xa0e764) Card=HASH(0xa0e804) Card=HASH(0xa0e8a4) Card=HASH(0xa0e944) Card=HASH(0xa0e9e4) Card=HASH(0xa0ea84) Card=HASH(0xa0eb24) Card=HASH(0xa0ebc4) Card=HASH(0xa0ec64) Card=HASH(0xa0ed04) Card=HASH(0xa0eda4) Card=HASH(0xa0ee44) Card=HASH(0xa0eee4) Card=HASH(0xa0ef84) Card=HASH(0xa0f024) Card=HASH(0xa0f0c4) Card=HASH(0xa0f164) Card=HASH(0xa0f204) Card=HASH(0xa0f2a4) Card=HASH(0xa0f344) Card=HASH(0xa0f3e4) Card=HASH(0xa0f484) Card=HASH(0xa0f524) Card=HASH(0xa0f5c4) Card=HASH(0xa0f664) Card=HASH(0xa0f704) Card=HASH(0xa0f7a4) Card=HASH(0xa0f844) Card=HASH(0xa0f8e4) Card=HASH(0xa0f984) Card=HASH(0xa0fa24) Card=HASH(0xa0fac4) Card=HASH(0xa0fb64) Card=HASH(0xa0fc04) Card=HASH(0xa0fca4) Card=HASH(0xa0fd44) Card=HASH(0xa0fde4) Card=HASH(0xa0fe84) Card=HASH(0xa0ff24) Card=HASH(0xa0ffc4) Card=HASH(0xa10064) Card=HASH(0xa10104) Card=HASH(0xa101a4) Card=HASH(0xa10244) Card=HASH(0xa102e4) Card=HASH(0xa10384) Card=HASH(0xa10424) Card=HASH(0xa104c4) Card=HASH(0xa10564) Card=HASH(0xa10604) Card=HASH(0xa106a4) Card=HASH(0xa10744) Card=HASH(0xa107e4) Card=HASH(0xa10884) Card=HASH(0xa10924) Card=HASH(0xa109c4) Card=HASH(0xa10a64) Card=HASH(0xa10b04) Card=HASH(0xa10ba4) Card=HASH(0xa10c44) Card=HASH(0xa10ce4) Card=HASH(0xa10d84) Card=HASH(0xa10e24) Card=HASH(0xa10ec4) Card=HASH(0xa10f64) Card=HASH(0xa11004) Card=HASH(0xa110a4) Card=HASH(0xa11144) Card=HASH(0xa111e4) Card=HASH(0xa11284) Card=HASH(0xa11324) Card=HASH(0xa113c4) Card=HASH(0xa11464) Card=HASH(0xa11504) Card=HASH(0xa115a4) Card=HASH(0xa11644) Card=HASH(0xa116e4) Card=HASH(0xa11784) Card=HASH(0xa11824) Card=HASH(0xa118c4) Card=HASH(0xa11964) Card=HASH(0xa11a04) Card=HASH(0xa11aa4) Card=HASH(0xa11b44) Card=HASH(0xa11be4) Card=HASH(0xa11c84) Card=HASH(0xa11d24) Card=HASH(0xa11dc4) Card=HASH(0xa47934) Card=HASH(0xa479d4) Card=HASH(0xa47a74) Card=HASH(0xa47b14) Card=HASH(0xa47bb4) Card=HASH(0xa47c54) Card=HASH(0xa47cf4) Card=HASH(0xa47d94) Card=HASH(0xa47e34) Card=HASH(0xa47ed4) Card=HASH(0xa47f74) Card=HASH(0xa48014) Card=HASH(0xa480b4) Card=HASH(0xa48154) Card=HASH(0xa481f4) Card=HASH(0xa48294) Card=HASH(0xa48334) Card=HASH(0xa483d4) Card=HASH(0xa48474) Card=HASH(0xa48514) Card=HASH(0xa485b4) Card=HASH(0xa48654) Card=HASH(0xa486f4) Card=HASH(0xa48794) Card=HASH(0xa48834) Card=HASH(0xa488d4) Card=HASH(0xa4b93c) Card=HASH(0xa4b9dc) Card=HASH(0xa4ba7c) Card=HASH(0xa4bb1c) Card=HASH(0xa4bbbc) Card=HASH(0xa4bc5c) Card=HASH(0xa4bcfc) Card=HASH(0xa4bd9c) Card=HASH(0xa4be3c) Card=HASH(0xa4bedc) Card=HASH(0xa4bf7c) Card=HASH(0xa4c01c) Card=HASH(0xa4c0bc) Card=HASH(0xa4c15c) Card=HASH(0xa4c1fc) Card=HASH(0xa4c29c) Card=HASH(0xa4c33c) Card=HASH(0xa4c3dc) Card=HASH(0xa4c47c) Card=HASH(0xa4c51c) Card=HASH(0xa4c5bc) Card=HASH(0xa4c65c) Card=HASH(0xa4c6fc) Card=HASH(0xa4c79c) Card=HASH(0xa4c83c) Card=HASH(0xa50084) Card=HASH(0xa50124) Card=HASH(0xa501c4) Card=HASH(0xa50264)
     4.5 \ No newline at end of file
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/filter.pl	Tue Sep 08 02:45:26 2009 -0400
     5.3 @@ -0,0 +1,32 @@
     5.4 +sub filter
     5.5 +{
     5.6 +
     5.7 +	$ref = shift;
     5.8 +	@list = @_;
     5.9 +	my @ret = ();
    5.10 +	
    5.11 +	for $element(@list)
    5.12 +	{
    5.13 +		if ($ref->($element))
    5.14 +		{
    5.15 +			push @ret, $element;
    5.16 +		}
    5.17 +	}
    5.18 +
    5.19 +	return @ret
    5.20 +	
    5.21 +}
    5.22 +
    5.23 +
    5.24 +
    5.25 +
    5.26 +@test = (1,2,3,4,5,6);
    5.27 +
    5.28 +sub even
    5.29 +{
    5.30 +	return ($_[0]%2 == 0);
    5.31 +}
    5.32 +
    5.33 +@rr = &filter(\&even, @test);
    5.34 +
    5.35 +print "@rr";
    5.36 \ No newline at end of file
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/filter.pm	Tue Sep 08 02:45:26 2009 -0400
     6.3 @@ -0,0 +1,26 @@
     6.4 +package Filter;
     6.5 +use base 'Exporter';
     6.6 +our @EXPORT = ('filter');
     6.7 +
     6.8 +
     6.9 +sub filter
    6.10 +{
    6.11 +
    6.12 +	$ref = shift;
    6.13 +	@list = @_;
    6.14 +	my @ret = ();
    6.15 +	
    6.16 +	for $element(@list)
    6.17 +	{
    6.18 +		if ($ref->($element))
    6.19 +		{
    6.20 +			push @ret, $element;
    6.21 +		}
    6.22 +	}
    6.23 +
    6.24 +	return @ret
    6.25 +	
    6.26 +}
    6.27 +
    6.28 +
    6.29 +1;
    6.30 \ No newline at end of file
     7.1 --- a/index.html	Mon Aug 31 14:53:15 2009 -0400
     7.2 +++ b/index.html	Tue Sep 08 02:45:26 2009 -0400
     7.3 @@ -14,8 +14,24 @@
     7.4  <div id="num2" style="border: 1px solid black; width: 440px; height: 80px; overflow: auto">
     7.5  </div>
     7.6  
     7.7 -<input type="button" id="b2" size="6" value='Generate Booster Pack' onclick="perl_script(['NO_CACHE'], ['out1']);"><br/>
     7.8 -<input type="button" id="b3" size="6" value='Generate Booster Pack' onclick="num2(['NO_CACHE'], ['num2']);"><br/>
     7.9 +<input type="button" id="b2" size="6" value='Generate Booster Pack' onclick="gen_pack(['NO_CACHE'], ['out1']);"><br/>
    7.10 +
    7.11 +
    7.12 +
    7.13 +<form>
    7.14 +<DIV id="radiobuttons" onclick="change_rules(['radio1'], ['result'] );"> 
    7.15 +<input TYPE="radio" ID="radio1" NAME="radio1" VALUE="Base Set">Base Set 
    7.16 +<input TYPE="radio" ID="radio1" NAME="radio1" VALUE="Jungle">Jungle
    7.17 +<input TYPE="radio" ID="radio1" NAME="radio1" VALUE="Fossil">Fossil
    7.18 +<input TYPE="radio" ID="radio1" NAME="radio1" VALUE="Team Rocket">Team Rocket
    7.19 +<input TYPE="radio" ID="radio1" NAME="radio1" VALUE="Gym Challenge">Gym Challenge 
    7.20 +<input TYPE="radio" ID="radio1" NAME="radio1" VALUE="Gym Heroes">Gym Heroes
    7.21 +
    7.22 +
    7.23 +
    7.24 +</DIV> 
    7.25 +<div id='result'> </div>
    7.26 +</form>
    7.27  
    7.28  
    7.29  <a href = "rules.pl">rules</a>   <a href = "cards.pl">cards</a> 
     8.1 --- a/index.pl	Mon Aug 31 14:53:15 2009 -0400
     8.2 +++ b/index.pl	Tue Sep 08 02:45:26 2009 -0400
     8.3 @@ -1,13 +1,24 @@
     8.4  #!C:/strawberry/perl/bin/perl.exe
     8.5  
     8.6 -
     8.7 +use List::Util qw(first max maxstr min minstr reduce shuffle sum);
     8.8 +use Storable;
     8.9  use CGI::Ajax;
    8.10  use CGI;
    8.11 -
    8.12 +use Rule;
    8.13 +use Filter;
    8.14 +use Card;
    8.15  my $q = new CGI;
    8.16  
    8.17  
    8.18 -my %hash = ( 'perl_script' => \&work, 'num2' => \&funtwo);
    8.19 +
    8.20 +my $refstruct = retrieve 'CARD.perl';
    8.21 +my @pokes = @$refstruct;
    8.22 +
    8.23 +
    8.24 +
    8.25 +
    8.26 +
    8.27 +my %hash = ( 'gen_pack' => \&gen_pack, 'change_rules' => \&change_rules);
    8.28  
    8.29  
    8.30  
    8.31 @@ -15,31 +26,92 @@
    8.32  
    8.33  
    8.34  my $pjx = CGI::Ajax->new(%hash);
    8.35 -$pjx->JSDEBUG(1);
    8.36 -$pjx->DEBUG(1);
    8.37 +#$pjx->JSDEBUG(1);
    8.38 +#$pjx->DEBUG(1);
    8.39 +
    8.40  print $pjx->build_html($q,\&gen); # this outputs the html for the page
    8.41  
    8.42  
    8.43  
    8.44  
    8.45  
    8.46 +sub change_rules
    8.47 +{
    8.48 +	my $currentRuleref = retrieve 'rlm/booster.prefs';
    8.49 +	$currentRule = $$currentRuleref;
    8.50 +	$a = shift;
    8.51 +	$currentRule -> setSets(($a));
    8.52 +	store \$currentRule, 'rlm/booster.prefs'; 
    8.53 +	return $a;
    8.54 +  
    8.55 +	
    8.56 +}
    8.57  
    8.58 -sub funtwo
    8.59 +
    8.60 +
    8.61 +
    8.62 +
    8.63 +
    8.64 +
    8.65 +
    8.66 +
    8.67 +
    8.68 +sub gen_pack
    8.69  {
    8.70 -	return 14;
    8.71 +	sub tag_analyze
    8.72 +	{
    8.73 +
    8.74 +	
    8.75 +	
    8.76 +	my @sets = $currentRule -> getSets();
    8.77 +	#print ERR @sets;
    8.78 +	
    8.79 +	my $card = shift;
    8.80 +	
    8.81 +	#print ERR $card->getPix();
    8.82 +	#print ERR "\n";
    8.83 +	return $card -> hasTags(@sets);
    8.84 +	
    8.85 +		
    8.86 +	}
    8.87 +		
    8.88 +	my $currentRuleref = retrieve 'rlm/booster.prefs';
    8.89 +	$currentRule = $$currentRuleref;
    8.90 +	
    8.91 +	#print ERR "@pokes";
    8.92 +	@reduced = filter(\&tag_analyze, @pokes);
    8.93 +	
    8.94 +	#print ERR "@reduced";
    8.95 +	
    8.96 +	for $crd(@reduced)
    8.97 +	{
    8.98 +		#print ERR $crd->getPix();
    8.99 +		$rob = $rob.$crd->getPix();
   8.100 +		$rob = $rob."<br>";
   8.101 +	}
   8.102 +
   8.103 +	#print $rob;
   8.104 +
   8.105 +	#print ERR @reduced;
   8.106 +	#print ERR $rob;
   8.107 +	#print $rob;
   8.108 +	return $rob;
   8.109 +	#close ERR;
   8.110 +	
   8.111 +	
   8.112  };
   8.113  
   8.114  
   8.115  
   8.116 -sub work
   8.117 -{
   8.118 -	return 13;	
   8.119 -};
   8.120 -
   8.121  
   8.122  
   8.123  sub gen
   8.124  {
   8.125  open FILE, "<index.html";
   8.126  return do { local $/; <FILE> };
   8.127 -};
   8.128 \ No newline at end of file
   8.129 +};
   8.130 +
   8.131 +#print "done";
   8.132 +
   8.133 +#print &change_rules("Fossil");
   8.134 +#print &gen_pack;
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/pjx_radio.pl	Tue Sep 08 02:45:26 2009 -0400
     9.3 @@ -0,0 +1,49 @@
     9.4 +#!C:/strawberry/perl/bin/perl.exe
     9.5 +use strict;
     9.6 +use CGI::Ajax 0.57;
     9.7 +use CGI;
     9.8 +
     9.9 +my $q = new CGI;  # need a new CGI object
    9.10 +
    9.11 +# compose our list of functions to export to js
    9.12 +my %hash = ( 'myFunc'         => \&perl_func,);
    9.13 +
    9.14 +my $pjx = CGI::Ajax->new( %hash ); # this is our CGI::Ajax object
    9.15 +
    9.16 +$pjx->DEBUG(1);   # turn on debugging
    9.17 +$pjx->JSDEBUG(1); # turn on javascript debugging, which will place a
    9.18 +                  #  new div element at the bottom of our page showing
    9.19 +                  #  the asynchrously requested URL
    9.20 +
    9.21 +print $pjx->build_html( $q, \&Show_HTML ); # this builds our html
    9.22 +                                           #  page, inserting js
    9.23 +
    9.24 +# This subroutine is responsible for outputting the HTML of the web
    9.25 +# page. 
    9.26 +sub Show_HTML {
    9.27 +  my $html = <<EOT;
    9.28 +<HTML>
    9.29 +<HEAD><title>Radio Example</title>
    9.30 +</HEAD>
    9.31 +<BODY>
    9.32 +<form>
    9.33 +<DIV id="radiobuttons" onclick="myFunc( ['radio1'], ['result'] );"> 
    9.34 +<input TYPE="radio" ID="radio1" NAME="radio1" VALUE="red">red 
    9.35 +<input TYPE="radio" ID="radio1" NAME="radio1" VALUE="blue">blue 
    9.36 +<input TYPE="radio" ID="radio1" NAME="radio1" VALUE="yellow">yellow 
    9.37 +<input TYPE="radio" ID="radio1" NAME="radio1" VALUE="green">green 
    9.38 +</DIV> 
    9.39 +<div id='result'> </div>
    9.40 +</form>
    9.41 +</BODY>
    9.42 +</HTML>
    9.43 +EOT
    9.44 +
    9.45 +  return($html);
    9.46 +}
    9.47 +
    9.48 +# this is the exported function 
    9.49 +sub perl_func {
    9.50 +  $a = shift;
    9.51 +  return $a . " was selected"; 
    9.52 +}
    10.1 Binary file rlm/booster.prefs has changed
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/rulegen.pl	Tue Sep 08 02:45:26 2009 -0400
    11.3 @@ -0,0 +1,4 @@
    11.4 +use Storable;
    11.5 +use Rule;
    11.6 +my $currentRule = Rule -> new();
    11.7 +store \$currentRule, 'rlm/booster.prefs';
    11.8 \ No newline at end of file
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/ruletest.pl	Tue Sep 08 02:45:26 2009 -0400
    12.3 @@ -0,0 +1,3 @@
    12.4 +use Rule;
    12.5 +$currentRule = Rule->new();
    12.6 +print $currentRule -> getSets();
    12.7 \ No newline at end of file