40 lines
1.4 KiB
Plaintext
40 lines
1.4 KiB
Plaintext
import "cards.asy" as cards;
|
|
import "numerals.asy" as numerals;
|
|
import "suits.asy" as suits;
|
|
|
|
for (int suit = 0; suit <= 5; ++suit) {
|
|
currentpen = evenodd+suit_colors[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));
|
|
} else if (suit == CARDS && value > 6) {
|
|
// conversely, face cards don't need as much recursion depth
|
|
// because the only icons present are significantly smaller
|
|
fill(recursive_card(value, suit, 3));
|
|
} else {
|
|
fill(recursive_card(value, suit));
|
|
}
|
|
|
|
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("build/"+value_str+"-"+suit_str, "svg");
|
|
}
|
|
}
|