Skip to content
Snippets Groups Projects
Commit 6d9ac2c5 authored by Louis Chmielewski's avatar Louis Chmielewski
Browse files

compare class Card

parent 06a017ec
Branches
No related tags found
No related merge requests found
......@@ -98,7 +98,13 @@ class Card(object):
$$$ c1.compare(c3) == 0
True
"""
...
if Card.VALUES.index(self.value) > Card.VALUES.index(card.value):
res = 1
elif Card.VALUES.index(self.value) < Card.VALUES.index(card.value):
res = -1
else:
res = 0
return res
@staticmethod
def deck(n_card: int) -> list[Card]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment