diff --git a/cgi-bin/uebung08/hangman_lib.php b/cgi-bin/uebung08/hangman_lib.php index 9dbcdc7..a996130 100644 --- a/cgi-bin/uebung08/hangman_lib.php +++ b/cgi-bin/uebung08/hangman_lib.php @@ -76,7 +76,7 @@ function guessLetter($letter) { $_SESSION['mask'] = $newMask; //if the guessword doesn't contain the letter increment errorCount - if (!$wordcontainsletter) { + if (!$wordcontainsletter && $_SESSION['errorCount'] < 10) { $_SESSION['errorCount'] = $_SESSION['errorCount'] + 1; }