Implement the game of Blackjack.
After completing this assignment, you should understand:
- how to track state by using objects
After completing this assignment, you should be able to:
- Build an interactive game
- Test an object-oriented program
- A Git repo called blackjack containing at least:
README.rst
file explaining how to run your project- a
requirements.txt
file - a full suite of tests for your project
- Passing unit tests
- No PEP8 or Pyflakes warnings or errors
Take your notes and code from the previous project. Using those, create a game of Blackjack that one person plays on the command line against a computer dealer, with the following rules:
- The game should start the player with $100 and bets are $10.
- The only valid moves are hit and stand.
- Allow the player to keep playing as long as they have money.
- The dealer uses one deck in their shoe and reshuffles after each round.
In addition to the requirements from Normal Mode:
- The dealer uses a shoe of six decks. With a shoe, the dealer uses something called a cut card. A plastic card is inserted somewhere near the bottom of the shoe. Once it is hit, the shoe is reshuffled at the end of the round. You can simulate this by reshuffling after there are 26 or less cards left in the shoe.
- The player can choose how much they want to bet before each round.
- Add doubling-down.
- Add surrender (early surrender as opposed to late surrender.)
- Add insurance.
- Add splitting hands.
In addition to the requirements from Hard Mode:
- Add the ability to choose rulesets, like:
- No surrender/early surrender/late surrender.
- Dealer hits soft 17 vs dealer stands of soft 17.
- Number of decks used in the shoe.
Each choice should be able to be made separately.
This is again an assignment with a text-based interface, which can be very hard to test. You will do best at this assignment by building all the logic for each piece and testing it well before then adding the interface on top of it.