Uploaded by ABISHEK Dhakal

Blackjack Flowchart

advertisement
START
User: [5, 10]
User = 15
Computer: [3, 6]
Computer = 9
The user and computer should
each get 2 random cards.
Add up the user's and
the computer's scores
User has blackjack
Win
Does the user or
computer have a blackjack?
(ace + 10)
Computer has blackjack
No Blackjacks
Lose
Yes
No
No
Is user's score over 21?
Yes
Do they have an
"Ace"?
Lose
Yes
If the ace counts
as a 1 instead of 11, are they
still over 21?
No
No
Answer = "Yes"
Ask the user if they want
to get another card.
User: [5, 10, 3]
Yes
Draw another card
No
Computer: [3, 6]
Computer plays, if score is less
than 17, keep drawing cards.
Computer: [3, 6, 10]
Yes
Has computer gone
over 21?
Win
No
User score
Computer = 19
Win
higher
Compare user score with
computer score to see if user
score is higher?
User = 18
Outcome: Computer wins.
Same score
Draw
User score
Lose
lower
Download