diff --git a/Gin_Rummy_Card_Game.py b/Gin_Rummy_Card_Game.py index b7d1282..ee5c202 100644 --- a/Gin_Rummy_Card_Game.py +++ b/Gin_Rummy_Card_Game.py @@ -1,6 +1,7 @@ import random from collections import defaultdict from itertools import combinations +import time # Define card ranks and their order for runs RANK_ORDER = {str(n): n for n in range(2, 11)} @@ -26,6 +27,7 @@ class Card: class Deck: def __init__(self): self.cards = [Card(rank, suit) for suit in Card.suits for rank in Card.ranks] + random.seed(time.time()) # Seed random number generator with current time random.shuffle(self.cards) def draw(self): @@ -112,7 +114,7 @@ class Game: self.deal() print("Initial hands:") for p in self.players: - print(p.name, p.hand) + print(f"{p.name}'s {p.hand}") # Function to detect sets