Removed last of the single-letter variables

This commit is contained in:
christopher.millward
2022-01-04 10:46:44 -05:00
parent fe6ff50d2f
commit a6957caed0

View File

@@ -134,12 +134,12 @@ async function main() {
let shouldContinuePlaying = true; let shouldContinuePlaying = true;
while (deck.length > 0 && shouldContinuePlaying) { while (deck.length > 0 && shouldContinuePlaying) {
const m1 = deck.shift(); // Take a card const playerCard = deck.shift(); // Take a card
const m2 = deck.shift(); // Take a card const computerCard = deck.shift(); // Take a card
printCards(cards[m1], cards[m2]); printCards(cards[playerCard], cards[computerCard]);
const playerCardValue = computeCardValue(m1); const playerCardValue = computeCardValue(playerCard);
const computerCardValue = computeCardValue(m2); const computerCardValue = computeCardValue(computerCard);
if (playerCardValue < computerCardValue) { if (playerCardValue < computerCardValue) {
computerScore++; computerScore++;
print("THE COMPUTER WINS!!! YOU HAVE " + playerScore + " AND THE COMPUTER HAS " + computerScore + "\n"); print("THE COMPUTER WINS!!! YOU HAVE " + playerScore + " AND THE COMPUTER HAS " + computerScore + "\n");