Question: Create a function, called spin, in the head section that takes no parameters but returns a random number between 0 and 6 inclusive. Call this
Create a function, called spin, in the head section that takes no parameters but returns a random number between 0 and 6 inclusive. Call this function three times and assign it to different variables. Create another function, called evaluateGame, that takes three parameters and returns the a integer. (ALL WINS are evaluated from left to right - 4, 0, 0 would be a losing game) If there are three 0's for the random values win 14 If there are three of any other number win 7 If there are two 0'sin the first and second spot them win 4. If there are two of any other number in the first two spots win 2. If there are is a 0 in the first spot then win 1. The function will return the win score. Create a function that takes in a single number. Based on that number you get print picture. (0 is cherry, the rest do not matter). Underneath the three pictures print the winning score. Put the above requirements in either a for loop or a while loop and do it three times. (Therefore, you should have three slot machines.) Put a hyperlink at the bottom that links to the same page, make the text say "spin". Total
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
