C#C
C#3y ago
92 replies
AbyssForger

✅ Blackjack Dealer goes into an infinite loop (SOLVED)

https://paste.ofcode.org/egKC5vE9biPBKhFyNhuksQ

Loop only happens if a) the Dealer stands, i.e. has a total between 17 and 20 inclusive and b) the player is at exactly 21/Blackjack.
The loop then only gives out debug output on Line 44 ("the dealer stands on {cardDealer}").
There are two variables, called stand (for the dealer) and playerStand (for the player) that should end the while loop of card drawing opportunities and go into the result calculation beginning with the if @ Line 77
Was this page helpful?