add asy file to generate the whole deck
This commit is contained in:
parent
1d22d75da6
commit
3efdefba9e
33
deck.asy
Normal file
33
deck.asy
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
import "cards.asy" as cards;
|
||||||
|
import "numerals.asy" as numerals;
|
||||||
|
|
||||||
|
for (int suit = 0; suit <= 5; ++suit) {
|
||||||
|
for (int value = 1; value <= 10; ++value) {
|
||||||
|
currentpicture = new picture;
|
||||||
|
filldraw(card, white, black);
|
||||||
|
|
||||||
|
if (suit == CARDS && value == 1) {
|
||||||
|
// due to exponential growth, with the larger suit icon on the 1
|
||||||
|
// card, the endpoint of the recursion is a *lot* more visible
|
||||||
|
fill(recursive_card(value, suit, 6), evenodd+red);
|
||||||
|
} else {
|
||||||
|
fill(recursive_card(value, suit), evenodd+red);
|
||||||
|
}
|
||||||
|
|
||||||
|
string suit_str;
|
||||||
|
if (suit == PUPPETS) { suit_str = "puppets"; }
|
||||||
|
else if (suit == BREAD) { suit_str = "bread"; }
|
||||||
|
else if (suit == WHEELS) { suit_str = "wheels"; }
|
||||||
|
else if (suit == BLADES) { suit_str = "blades"; }
|
||||||
|
else if (suit == CHAIRS) { suit_str = "chairs"; }
|
||||||
|
else { suit_str = "cards"; }
|
||||||
|
|
||||||
|
string value_str;
|
||||||
|
if (value == TRAVELER) { value_str = "traveler"; }
|
||||||
|
else if (value == KNIGHT) { value_str = "knight"; }
|
||||||
|
else if (value == WIZARD) { value_str = "wizard"; }
|
||||||
|
else if (value == NOBLE) { value_str = "noble"; }
|
||||||
|
else { value_str = format("%d", value); }
|
||||||
|
shipout(value_str+"-"+suit_str, "svg");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue