Skip to content

Update blackjack readme #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions BlackJackGame/BlackJackGame.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
dl = []

# Check Blackjack__________________________________________
def BlackJack(s):
def check_Twenty_One(s):
if s==21:
return True
else:
Expand Down Expand Up @@ -68,8 +68,13 @@ def playersTurn(s):

s = check_sum(s)

if (BlackJack(s)):
print("Hurray......It's a BLACKJACK....You Won\n")
if (check_Twenty_One(s)):
#Check Blackjack_______________________________________
if len(pl) == 2:
print("Hurray......It's a BLACKJACK....You Won\n")
#Check if player made 21_______________________________
else:
print("Awesome!!!......You made 21!....You Won\n")
return 2
elif (Bust(s)):
print("You got Bust.....You Lost\n")
Expand Down Expand Up @@ -123,8 +128,11 @@ def playersTurn(s):
print(f"\nDealer's current hand: {dl}\n")

s = check_sum(s)
if (BlackJack(s)):
print("Dealer got a BlackJack and won the Game\nYou Lost\n")
if (check_Twenty_One(s)):
if len(dl) == 2:
print("Dealer got a BlackJack and won the Game\nYou Lost\n")
else:
print("Dealer made 21 and won the Game\nBetter Luck Next Time!\n")
break
elif (Bust(s)):
print("Dealer got Busted\nYou Won\n")
Expand Down
18 changes: 17 additions & 1 deletion BlackJackGame/ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# Black Jack Game in Python

A simple game of 21 made for Python
A simplified game of 21 made for Python!

## Card Values
Suits do not affect card values.

2 - 10 all are the same value as the card name.
J, Q, and K are all worth 10.
Aces: If adding 11 would make the score go over 21, then the ace is worth 1. Otherwise, it is worth 11.

## Gameplay
Simply run the script to begin playing. The hand begins with both the player and dealer receiving two cards. The player only sees one of the dealer's cards at the start. The player goes first, choosing to Hit (Press 1) or Stay (Press 0). If the player recieves more than 21 points then they are Bust and have lost the hand. After the player selects Stay, it is then the dealers turn. The dealer Hits until they either receive a higher score than the player (player loses) or Bust (player wins).

## Blackjack
A player gets a 'Blackjack' if they are dealt a card worth 10 and an Ace at the beginning of the hand. This automatically wins the game.


**Note that for the purpose of this script is to allow the user to play a simple hand of Blackjack without some of the higher level parts of the game like betting or splitting doubles. All ties go to the player in this version of the game.

## Demo

Expand Down