Algorithm for Sweet Tooth
-
Create a menu with a PLAY, HOW TO PLAY, STATISTICS, CREDITS, and QUIT buttons
-
Print the menu to the Proteus screen
-
If user presses the PLAY button go to step 4
-
Randomly generate two numbers that correspond to either ice cream or milkshake dessert
-
Randomly generate 6 numbers that correspond to 6 flavors
-
Randomly generate 3 numbers that correspond to toppings – cherry, oreos, or sprinkles
-
Using the randomly generated numbers, display to the screen a randomly generated ice cream cone or a milkshake with one flavor (color of the ice cream scoop or milkshake) and one topping
-
Display the dessert for 3 seconds
-
Clear the screen
-
Instruct user to recreate the order
-
Create two buttons with a an ice cream on one button and a milkshake on the other
-
Display the two buttons
-
Allow user to touch one button
-
Clear the screen
-
Create 6 buttons for flavors of ice cream/milkshake with a color on each button
-
Display the 6 buttons
-
Allow user to touch one button
-
Clear the screen
-
Create 3 buttons for toppings, with a topping on each button (cherry, oreos, sprinkles)
-
Display the 3 buttons
-
Allow user to touch one button
-
Clear the screen
-
If the three user responses match with the randomly generated dessert from the order, assign a point to this round
-
Move points earned in this round to total point counter
-
If the sum of points earned in one round = 3 go to step 26, if not go to step 27
-
Add one to the number of perfect orders
-
Add one to the number of imperfect orders
-
Reset points for this round
-
Repeat steps 2-28 for 10 orders
-
Go to step 2
-
If user presses the HOW TO PLAY BUTTON go to step 32
-
Display instructions to the Proteus screen
-
Go to step 2
-
If user presses the STATS button, go to step 32
-
Display the number of total points
-
Display the number of perfect orders
-
Display the number of imperfect orders
-
Display the menu
-
If the CREDITS button is pressed, go to step 40
-
Display the credits to the screen
-
If the QUIT button is pressed, go to step 42
-
Exit the game and leave a message to the Proteus screen