diff --git a/__pycache__/card.cpython-311.pyc b/__pycache__/card.cpython-311.pyc index 3d49bc4..c8d7433 100644 Binary files a/__pycache__/card.cpython-311.pyc and b/__pycache__/card.cpython-311.pyc differ diff --git a/card.py b/card.py index f2a2bd2..73db566 100644 --- a/card.py +++ b/card.py @@ -11,5 +11,9 @@ class Card: def deal(self): self.face = randint(1, 11) + #I think here we should return 1-13 to include ace and face cards. + #This will make checking if 4 of a kind have been dealt easier. + #THEN when it comes to scoring we can use the value to calculate face cards as 10 points. + return self.face diff --git a/dealer.py b/dealer.py index 4f25141..a7f0998 100644 --- a/dealer.py +++ b/dealer.py @@ -2,18 +2,45 @@ import retro from card import Card #this code will be for creating a player to play against or to deal cards and to ask about your next action to continue the game. #this code will be the agent refered to as dealer for now. +dealer_hand=[] +player1_hand=[] + +def deal_first(): -def deal_first: - dealer_hand=[] - player1_hand=[] #deal two cards to the dealer one up and one down dealer_show = Card() - print("dealer shown card:"+ dealer_show) + while is_card_valid(dealer_show) == False: + dealer_show = Card() + if dealer_show == 1: + print("dealer shown card:"+ "Ace") + if dealer_show == 10: + print("dealer shown card:"+ "Jack") + #continue code here to show the correct face based on what was drawn + + print("dealer shown card:"+ str(dealer_show)) + dealer_hand.append(dealer_show) + dealer_hidden = Card() print("▮") dealer_hand.append(dealer_hidden) - #deal two cards to the player (both showing since it's one player) + + +def is_card_valid(card): + cards_dealt = [] + + + for card_face in cards_dealt: + if card_face == card: + return False + else: + cards_dealt.append(card) + return True + +deal_first() + + +