add asy file to generate the whole deck

This commit is contained in:
xenofem 2022-07-27 02:55:41 -04:00
parent 1d22d75da6
commit 3efdefba9e

33
deck.asy Normal file
View 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");
}
}