Skip to content

Commit

Permalink
Initialized values for the function
Browse files Browse the repository at this point in the history
  • Loading branch information
Tshidycodes committed Apr 7, 2024
1 parent 84e5060 commit c09cdbc
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
//in Blackjack ace is 1, J = 11, Q = 12, K = 13
let firstCard = getRandomCard();
let secondCard = getRandomCard();
let cards = [firstCard, secondCard]; //cards array - ordered list of items
let sum = firstCard + secondCard;
let cards = []; //cards array - ordered list of items
let sum = 0;
let hasBlackJack = false;
let isAlive = true;
let isAlive = false;

let message = "";
let messageEl = document.querySelector("#message-el");
Expand All @@ -24,6 +22,12 @@ function getRandomCard() {
}
}
function startGame() {
isAlive = true;
let firstCard = getRandomCard();
let secondCard = getRandomCard();
cards = [firstCard, secondCard];
sum = firstCard + secondCard;

renderGame();
}
function renderGame() {
Expand Down

0 comments on commit c09cdbc

Please sign in to comment.