Skip to content

Latest commit

 

History

History
45 lines (26 loc) · 2.06 KB

README.md

File metadata and controls

45 lines (26 loc) · 2.06 KB

Blackjack-with-Python

Object oriented implementation of the popular card game, Blackjack, using the Python programming language.

Description of the code

At this point, the point of the project is to create a simple object oriented manifestation of Blackjack using Python. The code (so far) consists of four .py files.

  1. bj_components.py contains the definitions of classes that define the objects nessecary to play Blackjack i.e. cards, decks, players and dealers.
  2. In blackjack.py, we define the Blackjack class that piecies the game together using objects of bj_components.py.
  3. The play_blackjack.py file creates a Blackjack object with a set of user defined parameters and runs the game.
  4. utils.py contains utilities that did not conceptually fit on any of the other files.

Running the code

To test the code for yourself tune the parameters on play_blackjack.py at will, open a command prompt, go to the code's directory and simply run

python play_blackjack.py

Screenshots

Some examplary screenshots.

image image

image image

image image

To-do list

Possible things to do now.

  1. Add 'split' functionality when Player has two cards of the same value.
  2. Add insurance when the dealer has a visible Ace at the start.
  3. Add shortcuts for blackjacks. i.e. the player does not need to play if the dealer gets a blackjack etc.
  4. Add bots. Maybe explore the statistics of bots with given strategies.
  5. Add a history log that saves data from played games.
  6. Add a "slow mode" functionality that uses time.sleep(delay) to make terminal output look smoother.