From 4c27ad0aab258defdaadda09c925093a322c7493 Mon Sep 17 00:00:00 2001 From: xenofem Date: Wed, 27 Jul 2022 08:43:43 -0400 Subject: [PATCH] reduce unnecessary recursion on face cards cards --- deck.asy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deck.asy b/deck.asy index d09ba1f..d6bc467 100644 --- a/deck.asy +++ b/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 // card, the endpoint of the recursion is a *lot* more visible 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 { fill(recursive_card(value, suit), evenodd+red); }