Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CardClass.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'''
def suit(card):
check_suit = card/13
if check_suit == 0:
Expand All @@ -24,6 +25,7 @@ def value(card):

def name_of_card(card):
return value(card) + " if " + suit(card)
'''


class Card:
Expand All @@ -35,10 +37,11 @@ def __init__(self,card1,card2,card3,card4):

def winner(self):
cards = [self.card2,self.card3,self.card4]
winner = self.card1
win = 0
for i in cards:
if suit(i) == suit(self.card1):
if value(i) > value(self.card1):
if i%13 > winner%13:
win = cards.index(i) + 1

return win