Question
1) Make a higher/lower number guessing game using a session. Grab the starter code for this game. On the first visit from the user, your
1) Make a "higher/lower" number guessing game using a session.
Grab the starter code for this game. On the first visit from the user, your PHP script should pick and "remember" (using session) a random number (1-100). The user should be able to submit a guess using the provided form. Your script should provide feedback on user guesses: higher, lower, correct The forms reset button should cause your script to regenerate (and re-remember) a new random number. Variations are welcome. For example: http://stungeye.com/school/esp/
This is the starter code:
session_start(); | |
define("RANDOM_NUMBER_MAXIMUM", 100); | |
define("RANDOM_NUMBER_MINIMUM", 1); | |
$user_submitted_a_guess = isset($_POST['guess']); | |
$user_requested_a_reset = isset($_POST['reset']); | |
// Implement the guessing game logic here. | |
?> | |
Guessing Game | |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started