'guessing3']); ?>
I'm thinking of a number between 1 and ", MAX_NUM, ". Can you guess it?
"; } else { // Not first load. Need to evaluate. $randno = $_SESSION['randno']; $guess = $_SESSION['guess']; $guesscount = $_SESSION['guesscount']; if($randno == $guess) { $start_form = 1; echo "Congratulations! Your guess of ", "$guess is correct! Would you like to play again?
"; } else { if($guess < $randno - MAX_NUM / 2) { $comm = "way too small"; $comcl = "wts"; } elseif($guess < $randno) { $comm = "too small"; $comcl = "ts"; } elseif($guess > $randno + MAX_NUM / 2) { $comm = "way too large"; $comcl = "wtl"; } else { // Already checked if it matches exactly. $comm = "too large"; $comcl = "tl"; } echo "No, your guess of $guess is $comm. "; // See if the game will continue. if($guesscount < GUESS_LIMIT) { echo "Care to try again? You have ", GUESS_LIMIT-$guesscount, " guesses left.
"; } else { echo "I'm sorry, you have used ", "all of your ", GUESS_LIMIT, " guesses. The ", "number I was thinking of was $randno. Would you ", "like to try again?
"; $start_form = 1; } } } } // Game continues. Generate the correct form. $me = $_SERVER['PHP_SELF']; if($start_form) { echo <<