0) { # user wants to guess a letter $guess = $_GET["guess"]; if (preg_match("/$guess/", $available)) { # not already guessed before; make the guess $available = preg_replace("/$guess/", " ", $available); setcookie("LAB5_SOLUTION_available", $available); if (!preg_match("/$guess/", $word)) { # an incorrect guess $guesses--; setcookie("LAB5_SOLUTION_guesses", $guesses); } } } # produce current clue string based on available letters $clue = preg_replace("/[$available]/", "?", $word); ?>
"= $word ?>"
"= $available ?>"