Guessing Game
Welcome to the number quessing game. Please enter a number between 1 and 25.";
}
else
{
if ($numToGuess == $myAns)
{
$toDisplay = "You guessed it! I have picked another number for you to try!
";
randNum();
}
else
This is where we left off after the class on Thursday. Under the else you have to include the code to
respond to the guess and tell whether it is correct and a new number has been picked or whether it is
too high or too low. Remember if you tell the user that a new number has been picked, you need to get a
new random number.
function randNum()
{
global $myAns;
global $toDisplay;
global $numToGuess;
Here is where you need to put the code to select a new random number. If you want a reference look at
my binary game to see how to do a random number.
}
function getGuess()
{
global $myAns;
global $toDisplay;
global $numToGuess;
print <<Guess the number: