Advertisement
Guest User

Untitled

a guest
Dec 16th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. Blackjack algorithm
  2. 1) Display "WELCOME TO BLACKJACK" title
  3. 2) Display the rules of Blackjack and how to play it.
  4. 3) Show the user their balance and ask them how much more would they like to deposit.
  5. 4) Get information from user.
  6. 5) Show the user their balance and ask them how much they would like to bet.
  7. 6) Get information from user.
  8. 7) Display the User's hand and show the current value of their hand.
  9. 8) Display the Dealer's faced up card and show they have one facing down.
  10. 9) Ask the user if they want to hit or stay.
  11. 10) Get information from user.
  12. 11) If the user hits, give them another card and Repeat steps 7-9.
  13. If the User busts, display a message showing that they busted
  14. Display the amount that they lost and show their current balance.
  15. Ask them the user if they want to play again.
  16. Get information from User
  17. If they say "Y" then start over from step 3.
  18. If they say "N" Display a goodbye message and show whether they won or lost money and how much.
  19. 12) If the User stays, end their turn and show the dealers cards.
  20. 13) If the dealer's total value is less than 17, give them another card and display total value. Repeat until the dealer busts or has a value of 17 or higher.
  21. 14) If the Dealer busts, display a message showing that the dealer busted.
  22. Display the amount that the user won and their current balance
  23. Ask them the user if they want to play again.
  24. Get information from User
  25. If they say "Y" then start over from step 3.
  26. If they say "N" Display a goodbye message and show whether they won or lost oney and how much.
  27. 15) If the Dealer gets a total value between 17-21, stop dealing cards.
  28. 14) Check the User's and Dealer's total value of their cards and compare them.
  29. 15) If the User has a higher calue than the Dealer, without either of them busting
  30. Display a message showing that the User won
  31. Display the amount that they won and show their current balance.
  32. Ask them the user if they want to play again.
  33. Get information from User
  34. If they say "Y" then start over from step 3.
  35. If they say "N" Display a goodbye message and show whether they won or lost oney and how much.
  36. 16) If the Dealer has a higher value than the User, without either of them busting
  37. Display a message showing that the User lost.
  38. Display the amount that the user lost and their current balance
  39. Ask them the user if they want to play again.
  40. Get information from User
  41. If they say "Y" then start over from step 3.
  42. If they say "N" Display a goodbye message and show whether they won or lost oney and how much.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement