wrights-deck/deck.asy

40 lines
1.4 KiB
Plaintext
Raw Normal View History

import "cards.asy" as cards;
import "numerals.asy" as numerals;
2022-07-27 08:53:22 -04:00
import "suits.asy" as suits;
for (int suit = 0; suit <= 5; ++suit) {
2022-07-27 08:53:22 -04:00
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
2022-07-27 08:53:22 -04:00
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
2022-07-27 08:53:22 -04:00
fill(recursive_card(value, suit, 3));
} else {
2022-07-27 08:53:22 -04:00
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); }
2022-07-27 03:23:26 -04:00
shipout("build/"+value_str+"-"+suit_str, "svg");
}
}