Skip to content

Commit

Permalink
small corrections in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kpranke committed Oct 6, 2021
1 parent efe3710 commit 341e672
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions utils/card.py
Original file line number Diff line number Diff line change
@@ -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."""
Expand All @@ -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."""
4 changes: 2 additions & 2 deletions utils/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
9 changes: 5 additions & 4 deletions utils/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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.")

Expand Down

0 comments on commit 341e672

Please sign in to comment.