From a31c7f985ceb8abb77f3191d5184fb117b842813 Mon Sep 17 00:00:00 2001 From: Adam <24621027+WhiteDopeOnPunk@users.noreply.github.com> Date: Sat, 31 Dec 2022 01:07:12 -0500 Subject: [PATCH] why lot word when few do trick --- blackjack.py | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/blackjack.py b/blackjack.py index 1e03337..b1f1359 100644 --- a/blackjack.py +++ b/blackjack.py @@ -2,12 +2,17 @@ from src.deck import Deck from src.io import CLI from src.gamemaster import GameMaster -def main(): - global kill - global ui - global num_decks - global deck +kill = False +ui = CLI() +print(ui.intro) +num_decks = ui.get_decks() +if num_decks == 'q': + kill = True +deck = Deck(num_decks) + +while not kill: game = GameMaster(deck) + game.active = True game.deal() @@ -18,17 +23,6 @@ def main(): print(ui.update(game)) -kill = False -ui = CLI() -print(ui.intro) - -num_decks = ui.get_decks() -if num_decks == 'q': - kill = True - -deck = Deck(num_decks) - -while not kill: - main() if not ui.play_again(): kill = True +