diff --git a/blackjack.py b/blackjack.py index be0e156..3c89dbe 100644 --- a/blackjack.py +++ b/blackjack.py @@ -20,9 +20,7 @@ def main(): ui.update(game) if game.active: - user_input = input(str(deck.count()) + ' cards left in deck.\n[H]it or [S]tand? ') - - match user_input.lower(): + match ui.player_move(deck).lower(): case 'y': game.active = False case 'q': diff --git a/src/io.py b/src/io.py index 11f6ff9..5069aec 100644 --- a/src/io.py +++ b/src/io.py @@ -121,3 +121,6 @@ o8YooP' 8 .oPYo. .oPYo. 8 .o 8 .oPYo. .oPYo. 8 .o return False case _: return True + + def player_move(self, deck): + return input(str(deck.count()) + ' cards left in deck.\n[H]it or [S]tand? ')