Skip to content

Commit

Permalink
Update BlackJack2Script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Mabbai authored Apr 3, 2024
1 parent 97efbce commit 02ff72d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion BlackJack2Script.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
document.addEventListener('DOMContentLoaded', () => { //Load everything first

hitButton.addEventListener('click', () => {
alertCenter(HANDPOOL.HAND, dealer, 'H')
alertCenter(HANDPOOL.HAND, dealer, 'H')
HANDPOOL.HAND.hit()
});
document.addEventListener('keypress', (event) => {
Expand Down Expand Up @@ -599,6 +599,13 @@ async function showHiddenCard(dealerHand) {
let hiddenCard = document.getElementById("hiddenCard")
let card = dealerHand[1]
let sort = card.rank + card.suit[0]

shoe.runningCount += shoe.stack
shoe.stack = 0
shoe.trueCount = shoe.runningCount/(shoe.cards.length/52)

document.getElementById("runningCount").innerText = `Running Count: ${shoe.runningCount}`
document.getElementById("trueCount").innerText = `True Count: ${shoe.trueCount.toFixed(2)}`

if (sort[0] === '1') {
sort = sort.slice(1,3)
Expand Down

0 comments on commit 02ff72d

Please sign in to comment.