Skip to content

Commit

Permalink
Fix deck not getting regenerated
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasdcampos authored Oct 8, 2024
1 parent 8411471 commit bd936fb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions blackjack.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ window.onload = function()
playAgainBtn.addEventListener("click", playAgain);
playAgainBtn.style.visibility = "hidden";

buildDeck();
shuffleDeck();
startGame();
}

async function startGame()
{
let ms = firstTime ? 0 : animationDelay;

buildDeck();
shuffleDeck();

hand.set("dealer", 0);
hand.set("player", 0);
aceCount.set("dealer", 0);
Expand Down Expand Up @@ -309,4 +310,4 @@ function log(message)
}

console.log(message);
}
}

0 comments on commit bd936fb

Please sign in to comment.