Blackjack Progress #4 [Penzu]

Wed. 7/15/2020:

Going to work on more Blackjack stuff today.

I’m thinking I’ll continue to look into the Split Deck Rules as I never managed to get to that the other day. I’ll first need to establish a method of checking whether the two cards the player draws are the same value in Round Start. If yes, create two decks and move each card into their own deck.

I think this should be fairly easy to work out…

EDIT: It wasn’t easy to work out due to the iteration. I though I had an idea of how to do it:

if(phand[i][prop].value =+ phand[i][prop].value){

console.log(“Matching Value!”)

}

but it didn’t work.

More importantly, there is now an issue with my JavaScript. No errors, but now the Array/Object arrangement of the Player and Dealer's hand is not how it was.

On roundStart, two cards are pushed into each Hand. but looking in the console, the Cards Array looks empty… it's not, that values are there, but they aren’t displayed. Moreover, when Hit() functions are run, it overrides the current contents of the Hand each time it runs, rather than adding it in like before.

It’s because both the first two cards have been placed in this weird empty but not empty Array, and this is being replaced by the new value.

I’ve gone through, commenting out each new thing I created in my last progress update but nothing fixed it. It’s something to do with how my arrays are structured, but I don’t know why they would have changed.