Skip to content

itstooerli/Blackjack_GUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blackjack - Learn Basic Strategy

Vegas-style blackjack game using Python Tkinter

This program provides an opportunity learn basic strategy for blackjack by providing a recommendation for what basic strategy would suggest given a scenario. Functionality includes bets, splits, double downs, and up to 6 other computer seats that also play blackjack basic strategy. You can also toggle the recommendation strategy off to simply play for fun.

Instructions

Running the program

  • This program requires the use of Python and the Python module Pillow.
  • Run the blackjack_GUI.py script

Configuring settings

  • You should then see a settings window that allows you set specific parameters for your game. blackjack_Settings
    • Number of decks (default 6): Specify number of 52-card decks to shuffle for this game, minimum=1, maximum=10
    • Number of players (default 3): Specify number of players to play at table, one player will be you the user, the rest will be computers, minimum=1, maximum=6
      • RECOMMENDATION: Less players will guarantee that all cards will fit on screen. Players are aligned horizontally and new cards are provided horizontally, therefore, cards may begin to fall off screen with 6 players, though very rare.
    • Player's seat number (default 1): Specify where at the table you'd like to sit, 1 being the earliest, the number specified in Number of players being the latest
    • Player's starting money (default 1000): Specifiy number to begin with for player's funds
    • NOTE: You must click Submit to actually change the setting. Otherwise, it will not save your change (and also verify that you submitted an integer)
  • When ready (or if you're fine with defaults), click Start Game.
  • You will then see a new game window.

Playing the Game

  • At the bottom of the game window, you will see how much money you have left and an input to specify how much you'd like to bet for the next hand. You will use this button whenever you want to start a new hand. command_frames
  • When ready, click Play (Submit Bet).
  • You'll now see the table generate and cards dealt to each of the players. blackjack_game
  • Your hand(s) will be under the label "You", which also provides the total amount of funds you have left.
  • The computers will automatically play their hands using basic strategy when it is their turn.
  • NOTE: If the dealer has 21, the round will automatically end and payouts will be distributed from that point.
  • When it is your turn, your hand's status (seen below you cards) will highlight in yellow.
  • The status label under the hand will indicate
    1. hand's current status
    2. the total amount that your hand adds up to
    3. the amount invested/bet into this hand
  • The possible statuses during play are
    • BLACKJACK: The hand is a blackjack (21 from first two cards without any action), no additional play is given to player in this scenario
    • ACTIVE: The hand is the current one being controlled
    • WAITING: The hand is waiting to be acted upon
    • STAND: The hand has completed action and is waiting for dealer to play
    • BUST: The hand has went over a total score of 21
  • You can then act on your hand, whether that be Hit, Double Down, Split, Stand.
    • Hit: Ask for another card
    • Double Down: The player chooses to double their original bet for one and only one extra card. The player can do no other action after doublign down.
    • Split: If the player's first two cards are the same denomination/rank (e.g. Queen and Queen, but not Queen and Jack), then they can choose to treat them as two separate hands. The original bet is placed on the first hand and an equal amount is placed on the second hand. Each hand is dealt and extra card and then play begins as normal for each hand. Normally, with a pair of aces, the player is given one card for each ace and no additional action can begin, but this is ignored for this iteration of the game.
    • Stand: Do not ask for another card and stay with current total
    • For more detailed rules, suggested to see Bicycle Cards Blackjack Rules.
  • This game also provides an opportunity to learn basic strategy. There is a Recommend Basic Strategy button that allows you to look at what basic strategy would recommend here. You can turn feature this on or off but clicking the toggle. recommendation
  • After play is complete, the status label will update with the result of the hand and the net change in funds for the player. blackjack_result Possible results are
    • Blackjack Winner: Player won with blackjack! (Payout is 1.5 * Bet.)
    • Winner: Player had a greater total than dealer or dealer busted
    • Push: Player tied dealer
    • Loser: Player had lower total than dealer or player busted
  • Play continues as from beginning of this subsection Playing the Game

Possible Next Steps

  • Optimizing sizing of window to allow for truncated views with larger number of players
  • Include other blackjack strategies, include card counting strategies

Authors

Contributors names

  • Eric Li

Related Games

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages