blob: 04a34e71fce2bddb3f32cb7f2a6077cd6e0f0ed2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
from __future__ import annotations
from blackjack.card import Card
from blackjack.hand import Hand
class Dealer:
def __init__(self) -> None:
self.hand = Hand()
def hit(self, deck: list(Card)) -> None:
self.hand.add_card(deck.pop())
def play(self, deck: list(Card)) -> None:
while self.hand.get_optimal_value() < 17:
self.hit(deck)
|