Part 2 flow
To the previous article Part 1
Part 2 start Players select cards they don’t need and discard them. Dealer-Replenish the number of discarded cards End
How to choose a card
A little modification of player.show to show numbered cards.
The player inputs the cards to be discarded with a space.
Change the selected card from hands array of player instance to
The player asks the dealer to deal the erased number of cards.
The dealer takes the requested number of cards from the deck and hands it to the player.
Part 2 code