mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
script for generating new cards list
This commit is contained in:
parent
6740cef9aa
commit
1d506d29dc
1 changed files with 33 additions and 0 deletions
33
Utils/extract_in_wiki_format.pl
Normal file
33
Utils/extract_in_wiki_format.pl
Normal file
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
|
||||
open CARDS, "< added_cards.txt" or die;
|
||||
|
||||
my $cards_count = 0;
|
||||
|
||||
my %cards;
|
||||
|
||||
while (<CARDS>) {
|
||||
my $line = $_;
|
||||
if ( $line =~/A Mage.Sets\\src\\mage\\sets\\(\w.*)\\(\w.*)\.java/ ) {
|
||||
$cards_count++;
|
||||
my $set = $1;
|
||||
my $card = $2;
|
||||
if (!exists($cards{$set})) {
|
||||
$cards{$set} = [];
|
||||
}
|
||||
|
||||
push $cards{$set}, $card;
|
||||
}
|
||||
}
|
||||
|
||||
open REPORT, "> added_cards_in_wiki_format.txt";
|
||||
print REPORT "Added cards ($cards_count):\n";
|
||||
foreach my $set (keys(%cards)) {
|
||||
print REPORT " $set: ";
|
||||
foreach my $card (@{$cards{$set}}) {
|
||||
print REPORT $card . ", ";
|
||||
}
|
||||
print REPORT "\n";
|
||||
}
|
Loading…
Reference in a new issue