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