Conditional branch blackjack

I'm working on a blackjack mini-game from scratch, for the sake of learning how things work under the hood a bit better, but I'm stuck on a conditional branch. I've got two variables (Card 1 and Card 2) that are randomly generated and added together for your initial hand. Before you get a chance to hit or stay, I want to check that you don't already have 21 from having drawn an ace and a face card.

Under the conditional branch, I was using the script

$gameVariables.value(201) == n && $gameVariables.value(202) == n

but how would I format the n value so it only accepts a 1 or a 10 in each, while rejecting a 2 through 9?
(I realize this setup also means the game thinks a 20 is blackjack. One step at a time)
You’ve chosen a game that seems simple but is actually not, for practice. First, you need to consider the rules of the game and build everything based on those rules.

Let’s say the initial calculation for the ace in relation to 21 is very simple. The program should always treat the ace as 11 and never as 1 (note: we’re talking about the first two cards).

From this consideration, I would suggest that when the random number 1 comes out, you save it as 11 in a temporary variable. When the second value comes out, you add it to the temporary variable. If the check gives me a value exactly equal to 21, I have my Blackjack.

Beware of the bug! Here, I run into a problem. How do I handle two aces? Their sum would be 22. However, since we’re dealing with a numeric value that cannot exceed 21 with two cards, we’ll need to translate 22 into 2.
Note that you technically don't need to be using code for this. All of this is perfectly doable using the default Conditional Branch commands. However, it does get a bit more convoluted.

You'd use JavaScript's OR operator, just like you're already using AND.

Code:
($gameVariables.value(201) == 1 || $gameVariables.value(201) == 10) && ($gameVariables.value(202) == 1 || $gameVariables.value(202) == 10)
Note that you technically don't need to be using code for this. All of this is perfectly doable using the default Conditional Branch commands. However, it does get a bit more convoluted.

You'd use JavaScript's OR operator, just like you're already using AND.

Code:
($gameVariables.value(201) == 1 || $gameVariables.value(201) == 10) && ($gameVariables.value(202) == 1 || $gameVariables.value(202) == 10)
I was trying to use || between the 1 and the 10 but couldnt quite grok why that didn't work how I wanted it to. This makes it make perfect sense. Thanks so much.

Original thread: https://forums.rpgmakerweb.com/threads/conditional-branch-blackjack.171790/