0% found this document useful (0 votes)
203 views1 page

Blackjack Flowchart

The user and computer each receive 2 random cards to start. Their scores are added up and checked for blackjack. If no player has blackjack, the user can choose to draw another card or pass. Then the computer draws cards until its score is at least 17. The scores are compared to determine the winner or a draw.

Uploaded by

marwal91
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
203 views1 page

Blackjack Flowchart

The user and computer each receive 2 random cards to start. Their scores are added up and checked for blackjack. If no player has blackjack, the user can choose to draw another card or pass. Then the computer draws cards until its score is at least 17. The scores are compared to determine the winner or a draw.

Uploaded by

marwal91
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

START

The user and computer should


User: [5, 10] Computer: [3, 6]
each get 2 random cards.

Add up the user's and


User = 15 Computer = 9
the computer's scores

User has blackjack


Win
Does the user or
No Blackjacks computer have a blackjack? Lose
(ace + 10) Computer has blackjack

Yes
No Lose
No

Yes If the ace counts


Do they have an
Is user's score over 21? as a 1 instead of 11, are they
"Ace"? Yes still over 21?

No
No

Answer = "Yes" Yes


Ask the user if they want
User: [5, 10, 3] to get another card.
Draw another card

No

Computer: [3, 6]
Computer plays, if score is less
Computer: [3, 6, 10]
 than 17, keep drawing cards.

Yes
Has computer gone 
Win
over 21?

No

User score  Compare user score with User score 


Computer = 19 Win computer score to see if user Lose
higher score is higher? lower
User = 18

Same score
Outcome: Computer wins.

Draw

You might also like