Created attachment 165 [details] Attachment: unplayedCards and playedCards incorrectly generated The current unplayedCards is empty and playedCards consist of more than 1 cards. Steps to reproduce: 1. Run the program 2. Play the game until unplayedCards are empty but playedCards consist more than 1 cards 3. Draw one card from deck 3. Alternative: attached test case Expected result: playedCards is empty and unplayedCards consist of all Cards except the card just taken from the Deck Actual result: playedCards is not empty and unplayedCards consist of less Cards expected
This is not a bug but by design. Explanation (using your the case) Before the action, unplayedCards.size() = 0 & playedCards.size() = 2 During the action, all playedCards **EXCEPT the top card** would be moved from playedCards to unplayedCards. Then, unplayedCards would be reshuffled. unplayedCards.size() = 1 & playedCards.size() = 1 After the action, unplayedCards is available for drawing. Player draws card. Finally, unplayedCards.size() = 0 & playedCards.size() = 1, in which we obtain the same result as your test case. Thank you for your debugging efforts!