I’ve managed the first three card sequences (2 3 4 5 6, 7 8 9 and 10 J Q K A) without much ado but the subsequent sequences have proven more challenging. Neither a set of if/else if/else statements nor a switch statement wouldn’t work on those.
I’m sorry, but I don’t think you fully understand what this challenge want you to do.
For case 2, 3, 4, 5, 6, it wants you to add 1 to the global variable count, and for 10 ‘j’ ‘q’ ‘k’ ‘a’, you need to -1 in count
I checked the link and compared that person’s code with my own. It seems I’ve over-thought this. I didn’t use count. My mistake. There was no need to include cases 7-9 in my switch statement because the count wasn’t supposed to change in those cases. My original if statement seems to have over-complicated the task, perhaps through excessive nesting (six layers). The other person’s if statement used a lot less code than mine. The return statements weren’t supposed to have a number, just the count variable + " Bet" if the count was incremented or " Hold" if the count was decremented.
Thank you for your help. I’ve ticked Solution under your last post.