Skip to content

artemrakov/python-black-jack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Milestone Project 2 - Walkthrough Steps Workbook Below is a set of steps for you to follow to try to create the Blackjack Milestone Project game!

Game Play To play a hand of Blackjack the following steps must be followed:

Create a deck of 52 cards Shuffle the deck Ask the Player for their bet Make sure that the Player's bet does not exceed their available chips Deal two cards to the Dealer and two cards to the Player Show only one of the Dealer's cards, the other remains hidden Show both of the Player's cards Ask the Player if they wish to Hit, and take another card If the Player's hand doesn't Bust (go over 21), ask if they'd like to Hit again. If a Player Stands, play the Dealer's hand. The dealer will always Hit until the Dealer's value meets or exceeds 17 Determine the winner and adjust the Player's chips accordingly Ask the Player if they'd like to play again Playing Cards A standard deck of playing cards has four suits (Hearts, Diamonds, Spades and Clubs) and thirteen ranks (2 through 10, then the face cards Jack, Queen, King and Ace) for a total of 52 cards per deck. Jacks, Queens and Kings all have a rank of 10. Aces have a rank of either 11 or 1 as needed to reach 21 without busting. As a starting point in your program, you may want to assign variables to store a list of suits, ranks, and then use a dictionary to map ranks to values.

The Game Imports and Global Variables Step 1: Import the random module. This will be used to shuffle the deck prior to dealing. Then, declare variables to store suits, ranks and values. You can develop your own system, or copy ours below. Finally, declare a Boolean value to be used to control while loops. This is a common practice used to control the flow of the game.

suits = ('Hearts', 'Diamonds', 'Spades', 'Clubs') ranks = ('Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Jack', 'Queen', 'King', 'Ace') values = {'Two':2, 'Three':3, 'Four':4, 'Five':5, 'Six':6, 'Seven':7, 'Eight':8, 'Nine':9, 'Ten':10, 'Jack':10, 'Queen':10, 'King':10, 'Ace':11}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages