-
Objective - To create an casino simulation
-
Purpose - To gain familiarity with general object orientation and design principles
-
Description
- The starter project lives in python/; see python/README.md to become oriented with its design.
- Create a casino simulation by extending or removing the pre-built implementations.
- It is advised that you create additional methods and classes to mediate any foreseen shortcomings of the prebuilt assets.
- Enforce the following features in your system:
- Ensure a console-based interface is available to allow input from and output to the users
- Ensure the
Casinohas a selection of at least 6 implementation ofGame. - Ensure
Playeris garbage collected upon completing a respectiveGameSlotsPlayershould be garbage collected whenSlotsGameis garbage collected.BlackJackPlayershould be garbage collected whenBlackJackGameis garbage collected.
- Ensure all implementation of
Playerhave reference to aCasinoAccountCasinoAccountshould not be garbage collected when aGameis garbage collected.
- Ensure at least 6 different implementations of
Gameand a respectivePlayerare defined. - Ensure at least 1 implementation of
Gamedoes not involve gambling. - Ensure at least 3 implementations of
Gameinvolve gambling.- Enable the player to wager a
balancethat can be persisted throughout different games; when aGameis garbage collected, the owner of thebalanceshould be able to play a new game with their newbalance.
- Enable the player to wager a
- Ensure all games which should support more than 1 player, have the ability to do so.
- Ensure there are at least 80% line coverage from testing the application.
-
Begin by implementing the
SlotsGame,SlotsPlayeras well asNumberGuessGameandNumberGuessPlayerprovided in themontycasino.gamespackage.
- To fork the project, click the
Forkbutton located at the top right of the project.
- Navigate to your github profile to find the newly forked repository.
- Copy the URL of the project to the clipboard.
- Clone the repository from your account into the
~/devdirectory.- if you do not have a
~/devdirectory, make one by executing the following command:mkdir ~/dev
- navigate to the
~/devdirectory by executing the following command:cd ~/dev
- clone the project by executing the following command:
git clone https://github.com/MYUSERNAME/NAMEOFPROJECT
- if you do not have a
- From the
python/directory, create a virtual environment and install the project:python3 -m venv .venv && source .venv/bin/activatepip install -e '.[dev]'
- Ensure that the tests run.
- You should see some tests pass and the tests for unimplemented features reported as
xfailed.
- You should see some tests pass and the tests for unimplemented features reported as
- Execute the command below to run the tests, with line coverage, from the command line.
pytest --cov=montycasino
- from a terminal navigate to the root directory of the cloned project.
- from the root directory of the project, execute the following commands:
- add all changes
git add .
- commit changes to be pushed
git commit -m 'I have added changes'
- push changes to your repository
git push -u origin master
- add all changes
- from the browser, navigate to the forked project from your github account.
- click the
Pull Requeststab. - select
New Pull Request
