Workshop › Blackjack › Step 16 of 22
When a round is over, N or Space deals the next one. A deck running low (under 15 cards) is replaced by a fresh shuffled one. If you can't pay the bet any more, the round says so, and the next deal starts you over with 100 chips.
```js
if (bank < BET) bank = START // out of chips: start over
if (deck.length < 15) newDeck()
if (bank < BET) message += ' - out of chips!'
else if (button === 'Deal' && phase === 'done') deal()
```message += ... adds to the end of the message.deal, start over when out of chips and replace a low deck.finish, add the out-of-chips note.press, deal when the round is done.Skills: Game states
← The dealer's turn Blackjack! →