added suffle function
This commit is contained in:
@@ -12,4 +12,9 @@ class Deck:
|
||||
for suit in suits:
|
||||
for value in values:
|
||||
self._cards.append(Card(suit, value))
|
||||
|
||||
|
||||
def shuffle(self):
|
||||
for i in range(len(self._cards)):
|
||||
j = random.randomrange(i, len(self._cards))
|
||||
self._cards[i], self._cards[j] = self._cards[j], self._cards[i]
|
||||
self._next_card = 0
|
||||
Reference in New Issue
Block a user