Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a sticky, self-processing PHP page that implements a simple guessing game. In this game, the program will pick a random integer between 1 and

Write a sticky, self-processing PHP page that implements a simple guessing game. In this game, the program will pick a random integer between 1 and 100 and the user will have 5 chances to guess what that number is. Note: Youll need to use session to keep track of the number between guesses. The game should present the user with a brief explanation of the rules, the number of guesses remaining and a simple form into which the user can enter their guess. Each time a guess is entered, the program should decrease the number of guesses remaining, and provide the user with feedback as follows: If the guess is not an integer in the range 1 to 100, redisplay the guess form with a message indicating the problem and ask the user to try again. If the guess is correct, dont display the form, notify the user of their win and provide them with a link that they can use to play again. If the guess is incorrect, inform the user whether their guess is too high or too low and how close they are as follows: o If their guess is within 5 of the correct answer, let the user know they are Getting Hot; o If their guess is within 10 of the correct answer, let the user know they are Getting Warm; o If their guess is within 15 of the correct answer, let the user know they are Getting Cool; and o In all other cases, let the user know they are Totally Cold; If the user has no chances remaining, thank them for playing and provide them with a link they can use to play again.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions