blackjack/main.py

26 lines
576 B
Python
Raw Permalink Normal View History

2022-12-31 21:32:54 -05:00
from src.deck import Deck
from src.io import CLI
from src.blackjack import Blackjack
2023-01-01 23:37:37 -05:00
from src.controller import PlayerController
2022-12-31 21:32:54 -05:00
def main():
2023-01-01 23:37:37 -05:00
player = PlayerController()
screen = CLI()
print(screen.intro)
deck = Deck(player.get_decks())
2022-12-31 21:32:54 -05:00
2023-01-01 23:37:37 -05:00
while player.seated:
2022-12-31 21:32:54 -05:00
game = Blackjack(deck)
game.deal()
2023-01-01 23:37:37 -05:00
game.check_player_blackjack()
print(screen.update(game))
2022-12-31 21:32:54 -05:00
while game.active:
2023-01-01 23:37:37 -05:00
game.update(player.get_input(deck.count()))
print(screen.update(game))
player.ask_deal_again()
main()