From 5e8b3b2ad2670c0d3b9575a666bde10473db384e Mon Sep 17 00:00:00 2001 From: aviyam Date: Mon, 3 Jan 2022 12:42:36 +0200 Subject: [PATCH] Fixed 2 issues: 1. Behavior of game play. New cards should be dealt every round. 2. As a result of 1, check that we have at least 3 cards for next round. --- 01_Acey_Ducey/python/acey_ducey_oo.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/01_Acey_Ducey/python/acey_ducey_oo.py b/01_Acey_Ducey/python/acey_ducey_oo.py index d8b7c752..325af4b4 100644 --- a/01_Acey_Ducey/python/acey_ducey_oo.py +++ b/01_Acey_Ducey/python/acey_ducey_oo.py @@ -95,11 +95,14 @@ class Game: self.not_done = False break - if len(self.deck.cards) <= 1: + if len(self.deck.cards) <= 3: print('You ran out of cards. Game over.') self.not_done = False break + self.card_a = self.deck.deal() + self.card_b = self.deck.deal() + if self.money == 0: self.not_done = False