C. Code Representation (Algorithm, Flowchart, or Pseudocode)

Algorithm for “Ride the Cota” Game:

  1. Create a game welcome screen to show game.
  2. Display the rules and instructions to game.
  3. Display various statistics such as prior game logs and high score recorded with lowest number of tries for victory.
  4. Display credits and who wrote the game (see above)
  5. Use DrawRectangle on QT Creator environment
  6. Display four face down cards on screen after menu.
  7. Create a 2D character array that is 52 by 2 for each card
  8. Display four cards initially on screen.
  9. Display another menu similar to welcome for first prompt with two choices “Black or Red?”
  10. Offer user choice of black or red
  11. Scan in option from user
  12. Display the result of unknown first card
  13. If user chooses correct option, proceed in game.
  14. If incorrect, end game with display message and “sad” music.
  15. Display “Wrong!” screen to user
  16. Display another choice menu similar to previous prompt with two choices “Over or Under?”
  17. Offer user choice of over or under
  18. Scan in option from user
  19. Display the result of unknown second card.
  20. If user chooses correct option, proceed in game.
  21. If incorrect, end game with display message and “sad” music.
  22. Display “Wrong!” screen to user.
  23. Display another choice menu similar to previous prompt with two choices “Inside or Outside Previous Cards?”
  24. Offer user choice of inside or outside.
  25. Scan in option from user
  26. Display the result of unknown third card.
  27. If user chooses correct option proceed in game.
  28. If incorrect, end game with display message and “sad” music.
  29. Display “Wrong!” screen to user.
  30. Display final choice menu for last prompt with FOUR choices “Clubs, Diamonds, Hearts or Spades?”
  31. Offer user choice of suit
  32. Scan in option from user
  33. Display the result of the final card.
  34. If user chooses incorrectly, end game with display message and “sad” music.
  35. Display “Wrong!” screen to user.
  36. If all 52 cards are played, display “You Lose!” message to user and give menu below.
  37. Display “Tap Screen To Play Again”, “Menu”, or “Quit”.
  38. Use a loop to return to beginning of game and prompt user with welcome screen.
  39. If user chooses correctly, end game with display message and “happy” music.
  40. Display “Congratulations, You Have Won The Game!”
  41. Display number of tries it took to win the game.
  42. Scan in this value and add it to the statistics class located in step 3.
  43. Finish