From 341e67259634862ccddddb4f2aa8ab0be1ad5c19 Mon Sep 17 00:00:00 2001 From: Kasia Pranke Date: Wed, 6 Oct 2021 16:24:56 +0200 Subject: [PATCH] small corrections in comments --- utils/card.py | 4 ++-- utils/game.py | 4 ++-- utils/player.py | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/utils/card.py b/utils/card.py index 32bb7c2..88a708a 100644 --- a/utils/card.py +++ b/utils/card.py @@ -1,5 +1,5 @@ class Symbol: - """A class to store the card symbols: icons and colors""" + """A class to store the card symbols: icons and colors.""" def __init__(self, color, icon): """Initialize a symbol and set its icon and color.""" @@ -25,4 +25,4 @@ def __str__(self): return f"{self.color}, {self.icon}, {self.value}" def create_list_of_cards(self): - """Creates a list with 4 cards""" + """Create a list with 4 cards.""" diff --git a/utils/game.py b/utils/game.py index 64f135b..bbc40b5 100644 --- a/utils/game.py +++ b/utils/game.py @@ -3,7 +3,7 @@ class Board: - """A class to stores a board""" + """A class to store a board.""" def __init__(self, players: list): self.players = players @@ -13,7 +13,7 @@ def __init__(self, players: list): def start_game(self): """ - Starts the game, fills a Deck, distributes cards of the Deck to the players. + Start the game, fill the deck, distribute cards of the deck to the players and loop over turns. """ print("The game has started.") deck = Deck() diff --git a/utils/player.py b/utils/player.py index 28dcf6e..8ccdc9c 100644 --- a/utils/player.py +++ b/utils/player.py @@ -4,7 +4,7 @@ class Player: - """A class to manage a player""" + """A class to manage a player.""" def __init__(self, name: str): self.name = name @@ -28,11 +28,12 @@ class Deck: """A class to store a deck of cards.""" def __init__(self): - """Initialize a deck of cards""" + """Initialize a deck of cards.""" self.cards = [] self.players = [] def fill_deck(self): + """Fill a deck of cards.""" icons = ["Club", "Heart", "Diamond", "Spade"] values = ["2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A"] for icon in icons: @@ -44,14 +45,14 @@ def fill_deck(self): self.cards.append(Card(color, icon, value)) def __str__(self): - """Shows a deck of cards""" + """Show a deck of cards.""" string_of_cards = "" for element in self.cards: string_of_cards += element.__str__() + " " return string_of_cards def shuffle(self): - """Shuffles all cards in the list of cards.""" + """Shuffle all cards in the list of cards.""" shuffle(self.cards) print("The deck has been shuffled.")