suit colors
This commit is contained in:
parent
4c27ad0aab
commit
847b9ec6d6
8
deck.asy
8
deck.asy
|
@ -1,7 +1,9 @@
|
||||||
import "cards.asy" as cards;
|
import "cards.asy" as cards;
|
||||||
import "numerals.asy" as numerals;
|
import "numerals.asy" as numerals;
|
||||||
|
import "suits.asy" as suits;
|
||||||
|
|
||||||
for (int suit = 0; suit <= 5; ++suit) {
|
for (int suit = 0; suit <= 5; ++suit) {
|
||||||
|
currentpen = evenodd+suit_colors[suit];
|
||||||
for (int value = 1; value <= 10; ++value) {
|
for (int value = 1; value <= 10; ++value) {
|
||||||
currentpicture = new picture;
|
currentpicture = new picture;
|
||||||
filldraw(card, white, black);
|
filldraw(card, white, black);
|
||||||
|
@ -9,13 +11,13 @@ for (int suit = 0; suit <= 5; ++suit) {
|
||||||
if (suit == CARDS && value == 1) {
|
if (suit == CARDS && value == 1) {
|
||||||
// due to exponential growth, with the larger suit icon on the 1
|
// due to exponential growth, with the larger suit icon on the 1
|
||||||
// card, the endpoint of the recursion is a *lot* more visible
|
// card, the endpoint of the recursion is a *lot* more visible
|
||||||
fill(recursive_card(value, suit, 6), evenodd+red);
|
fill(recursive_card(value, suit, 6));
|
||||||
} else if (suit == CARDS && value > 6) {
|
} else if (suit == CARDS && value > 6) {
|
||||||
// conversely, face cards don't need as much recursion depth
|
// conversely, face cards don't need as much recursion depth
|
||||||
// because the only icons present are significantly smaller
|
// because the only icons present are significantly smaller
|
||||||
fill(recursive_card(value, suit, 3), evenodd+red);
|
fill(recursive_card(value, suit, 3));
|
||||||
} else {
|
} else {
|
||||||
fill(recursive_card(value, suit), evenodd+red);
|
fill(recursive_card(value, suit));
|
||||||
}
|
}
|
||||||
|
|
||||||
string suit_str;
|
string suit_str;
|
||||||
|
|
|
@ -19,3 +19,12 @@ icons[CHAIRS] = chair;
|
||||||
icons[BLADES] = blade;
|
icons[BLADES] = blade;
|
||||||
icons[WHEELS] = wheel;
|
icons[WHEELS] = wheel;
|
||||||
icons[CARDS] = null;
|
icons[CARDS] = null;
|
||||||
|
|
||||||
|
pen suit_colors[] = { defaultpen, defaultpen, defaultpen, defaultpen, defaultpen, defaultpen };
|
||||||
|
|
||||||
|
suit_colors[PUPPETS] = black;
|
||||||
|
suit_colors[CARDS] = black;
|
||||||
|
suit_colors[BLADES] = red;
|
||||||
|
suit_colors[BREAD] = red;
|
||||||
|
suit_colors[CHAIRS] = blue;
|
||||||
|
suit_colors[WHEELS] = blue;
|
||||||
|
|
Loading…
Reference in a new issue