Question: I am taking computer science this summer so its twice as hard and fast and I seriously need help ! For this assignment you are

I am taking computer science this summer so its twice as hard and fast and I seriously need help !
 I am taking computer science this summer so its twice as
hard and fast and I seriously need help ! For this assignment
you are to write a simple computer game in which a player

For this assignment you are to write a simple computer game in which a player attempts to locate a pot of Leprechaun gold hidden in a building before it disappears. This game makes extensive use of branches and loops, with specific constructs required in specific situations. The extent of the building is 0 to 99 in all (3) directions, and the player initially has 200 seconds (20 tries) to find the gold before it disappears. Winning makes the game harder, losing makes it easier. Program Pseudocode . Initialize. Explain the program to the user, set initialTries to 20, call srand( time( NULL)). Declare all variables, including bool variables named "won" and "repeat" 2. Calculate gold location as random integers for xGold, yGold, and zGold in the range from 0 to 99 inclusive. ( Use rand( ) and the % operator for this step.) Set "won" to false. 3. Repeat the following steps initialTries times, using a for loop with a loop counter "tries" which starts out at 0 and continues as long as tries is less than initialTries, incrementing tries at the end of each iteration. "tries" is the number of tries already completed.) For each iteration, do the following: a. Inform the user that they have 10 remainingTries seconds left to find the gold where remainingTries initialTries- tries b. Ask the user for a location to test, reading in xGuess, yGuess, and zGuess. Ask for each value separately, and use while loops to only accept numbers from 0 to 99. Check to see if the guess is right, by comparing the X, Y, and Z values for equality. (E.g. does xGold equal xGuess, etc. You will need to use && for this test.) If the guess is correct, set "won" to true, increment tries, and then use break to exit the for loop early. c

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!