Help with counting card challenge

Hi everyone. I’m still new to programming

I already understand the logic of the answer by using switch. I just dont understand why the cards sequence 2,3,4,5,6 should return the string “5 Bet”.

Are there any explanations? Thanks before!

Hi Randell, thank you for your kind response.

Hmm, so if I start with let count = 4, and when I call the function cc(2), it will result in “5 Bet”?

I still don’t get the “sequence” part of this challenge. How can the sequence be executed if I were to play real Blackjack? My logic is when we are playing a real game with this code, each time we draw the card then it will update the “count” value. Assuming the first card is 2 and the initial count is 0, then cc(2) will be equal to “1 Bet”. How can we arrive at the “5 Bet” answer if there is only 1 round?

Thanks once again!

Ahh, I see. So “5 Bet” is the sum of those 5 cards that are made in 1 round, and not in one function. Really thankful for your explanation!

I still wonder how can we put those sequences in 1 function so it directly produce “5 Bet” answer and we don’t have to call the initial function multiple times. Can you help me with this? Thanks Randell!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.