magarena/scripts/mana_cost_graph.awk

25 lines
359 B
Awk
Raw Normal View History

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 "}"
}