reduce unnecessary recursion on face cards cards
This commit is contained in:
parent
f32775a63e
commit
4c27ad0aab
4
deck.asy
4
deck.asy
|
@ -10,6 +10,10 @@ for (int suit = 0; suit <= 5; ++suit) {
|
||||||
// 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), evenodd+red);
|
||||||
|
} 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), evenodd+red);
|
||||||
} else {
|
} else {
|
||||||
fill(recursive_card(value, suit), evenodd+red);
|
fill(recursive_card(value, suit), evenodd+red);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue