mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
Enchanced pick-order script.
This commit is contained in:
parent
f377eee8e0
commit
28a74c68b1
1 changed files with 12 additions and 4 deletions
|
@ -3,8 +3,13 @@
|
||||||
use Switch;
|
use Switch;
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
my $source = "zendikar-pick.htm";
|
print "Enter a set name: ";
|
||||||
my $destination = "result.txt";
|
my $set = <STDIN>;
|
||||||
|
chomp $set;
|
||||||
|
my $lset = lc($set);
|
||||||
|
|
||||||
|
my $source = "$lset.htm";
|
||||||
|
my $destination = "$lset.txt";
|
||||||
|
|
||||||
open SRC, "< $source" or die "Can't open source: $!\n";
|
open SRC, "< $source" or die "Can't open source: $!\n";
|
||||||
open DST, "> $destination" or die "Can't open destination: $!\n";
|
open DST, "> $destination" or die "Can't open destination: $!\n";
|
||||||
|
@ -17,6 +22,7 @@ my $max;
|
||||||
my $med;
|
my $med;
|
||||||
my $min;
|
my $min;
|
||||||
|
|
||||||
|
|
||||||
while (<SRC>) {
|
while (<SRC>) {
|
||||||
my $s = $_;
|
my $s = $_;
|
||||||
chomp $s;
|
chomp $s;
|
||||||
|
@ -72,7 +78,9 @@ while (<SRC>) {
|
||||||
$state = 11;
|
$state = 11;
|
||||||
}
|
}
|
||||||
} elsif ($state == 11) {
|
} elsif ($state == 11) {
|
||||||
print "$name|$rate|$med\n";
|
print DST "$set|$name|$rate|$med\n";
|
||||||
$state = 1;
|
$state = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
close DST;
|
Loading…
Reference in a new issue