Begin the rejuvenation of the blackjack game by creating a new folder to hold our new game. For simplicity, I will call this folder blackjack
.
Within this folder, create two others: casino
and casino_sounds
.
The casino
folder will become a package holding various aspects of a typical casino. This includes our old Hand
, Deck
, and Card
classes.
Within your casino
folder, create three files to house these. Name them hand.py
, deck.py
, and card.py
.
In each one, paste in the code from the relevant class.
If you are using an IDE with syntax checking, you may notice a few errors. These are due to the now-missing imports.
In deck.py
, ensure you have the following imports:
import random from .card import Card
The random
module is needed to shuffle our deck.
The Deck
class also relies on having instances of our Card
class, so we need to ensure we have access to it. We achieve this by using a relative import.
The relative import is indicated by a single or double dot...