else {
//this runs if the game is already in progress
if ($Num >$x)
{Echo "Your number, $Num, is too high. Please try again<p>";}
//if the number they guessed is bigger than x, it lets them know their guess was too high
elseif ($Num == $x)
{Echo "Congratulations you have won!<p>";
//if the number they guessed was correct it lets them know they won
Echo "To play again, please Choose a Number 1-100 <p>";
$x = rand (1,100) ;
//it then starts the game again by choosing a new value for $x that they can guess
}
else
{Echo "Your number, $Num, is too low. Please try again<p>";}
//if the answer is neither correct or to high, it tells them it is too low
}
?>
This section of code compares the winning number $x, to the number the user chose. It then either tells the user their guess was too high, too low, or they have won. If they win, it chooses another $x so they can play again.