HiLo - A Number Guessing Game

The computer has invented a random number somewhere between 0 and 100

Your task is to guess the number using the least number of turns.

Let's PLAY!

<back


Code:

<?php
 // new game
   $mystery = rand(0,100);   // number to be guessed
   $up = 100;                // upper boundary of guess range
   $down = 0;                // lower boundary of guess range
   $guess = "";              // initial value of guess
   $numguesses = 0;          // tally for guessses taken
   $feedback = "Let's PLAY!";
   echo $feedback . "<br>";
?>

<form name="takeaguess" method="post" action="part2.php">
  <input name="guess" type="text" value="<?php echo $guess; ?>" />
  <input name="mystery" type="text" value="<?php echo $mystery; ?>" />
  <input name="up" type="text" value="<?php echo $up; ?>"  />
  <input name="down" type="text" value="<?php echo $down; ?>"  />
  <input name="numguesses" type="text" value="<?php echo $numguesses; ?>"  />
  <input name="submit" type="submit" value="Take A Guess" />
<?php
   //change the TEXT to HIDDEN for everything but guess once we see the right values are there
   ?>
</form>