Add code_example.py
This commit is contained in:
70
code_example.py
Normal file
70
code_example.py
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
# card.py
|
||||||
|
class Card:
|
||||||
|
def __init__(self, rank, suit):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# deck.py
|
||||||
|
class Deck:
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def shuffle(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def deal_card(self):
|
||||||
|
pass
|
||||||
|
# hand.py
|
||||||
|
class Hand:
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def add_card(self, card):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def calculate_value(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def adjust_for_ace(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# player.py
|
||||||
|
class Player:
|
||||||
|
def __init__(self, name, chips=100):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def hit(self, deck):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def stand(self):
|
||||||
|
pass
|
||||||
|
# dealer.py
|
||||||
|
class Dealer(Player):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__("Dealer")
|
||||||
|
|
||||||
|
def play(self, deck):
|
||||||
|
pass
|
||||||
|
# game.py
|
||||||
|
class Game:
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def play_round(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def compare_hands(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def show_cards(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# main.py
|
||||||
|
if __name__ == "__main__":
|
||||||
|
game = Game()
|
||||||
|
game.play_round()
|
||||||
Reference in New Issue
Block a user