added rules and script to study mana symbol ordering
parent
f238a2306f
commit
803743aa4d
20
Makefile
20
Makefile
|
@ -345,8 +345,20 @@ cards/scored_by_td.tsv: cards/existing.txt
|
|||
./scripts/score_card.awk `ls -1 decks/td* | sort -n -t_ -k2` |\
|
||||
sort -rg |\
|
||||
./scripts/keep_unimplemented.awk $^ /dev/stdin > $@
|
||||
|
||||
cards/mtg_mana_costs:
|
||||
grep -ho "\(\{[^\}]\+\}\)\+" -r cards/cards.xml | sort | uniq > $@
|
||||
|
||||
cards/mag_mana_costs:
|
||||
grep -ho "\(\{[^\}]\+\}\)\+" -r src/magic/model/MagicManaCost.java release/Magarena/scripts | sort | uniq > $@
|
||||
|
||||
verify_mana_cost_order:
|
||||
join -v2 \
|
||||
<(grep -ho "\(\{[^\}]\+\}\)\+" -r cards/cards.xml | sort | uniq) \
|
||||
<(grep -ho "\(\{[^\}]\+\}\)\+" -r src/magic/model/MagicManaCost.java release/Magarena/scripts | sort | uniq)
|
||||
cards/mana_cost_graph.dot: cards/mtg_mana_costs
|
||||
cat $^ |\
|
||||
sed 's/{X}//g;s/{[[:digit:]]*}//g;s/{[CPQT]*}//g;/^$$/d' |\
|
||||
awk -f scripts/mana_cost_graph.awk > $@
|
||||
|
||||
cards/mana_cost_graph.png: cards/mana_cost_graph.dot
|
||||
circo $^ -Tpng -o $@
|
||||
|
||||
verify_mana_cost_order: cards/mtg_mana_costs cards/mag_mana_costs
|
||||
join -v2 $^
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
BEGIN {
|
||||
FS = "[{}]"
|
||||
print "strict digraph G {"
|
||||
}
|
||||
|
||||
{
|
||||
first = 0
|
||||
for (i = 1; i <= NF; i++) {
|
||||
if ($i != "") {
|
||||
if (!first) {
|
||||
printf("\"%s\"", $i);
|
||||
first = 1;
|
||||
} else {
|
||||
printf("-> \"%s\"", $i);
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
||||
END {
|
||||
print "}"
|
||||
}
|
Loading…
Reference in New Issue