Blackjack Update #7 [Penzu]

Nayfen
Oct 31, 2020

Tue. 7/28/2020:

I’ve fixed the two issues I’ve been having on my Blackjack code today without help from the web!

Issue one, the splitHand getting formatted incorrectly when splicing from playerHand I fixed by using the pop method (removing from the end of an array) rather than splice. Not sure why this made the difference but it did.

Issue two, was the method for triggering the split sequence. My logic was flawed; even playerScore = split but obviously, you could draw a 4 and a 6 and get an even score. I managed to figure out the correct way to check the two numbers were the same;

if(str[0].props.value === str[1].props.value)

I had something similar but this is comparing the first indexed object [0] with the second one [1].

I’ve now fully implemented Split rules, however, I’ve created a new issue by miss-using a while Loop. I know what I need to do to fix it; I just need to research where to put my break; points.

Feeling pretty good!

--

--