"; Output += "
"; Output += ""; Output += Navigation; Output += ""; Output += ""; if (Content.length > 0){ Output += ""; } Output += "
"; Output += Content; Output += "
"; FeedbackFrame.document.clear(); FeedbackFrame.document.open(); FeedbackFrame.document.write(Output); FeedbackFrame.document.close(); } function DisplayHangman(Exercise){ var Output = ""; Output += "
"; Output += Title; Output += "
"; Output += Subtitle; Output += "

"; Output += ""; Output += ""; Output += ""; Output += Navigation; Output += "
"; Output += Exercise; Output += "
"; HangmanFrame.document.clear(); HangmanFrame.document.open(); HangmanFrame.document.write(Output); HangmanFrame.document.close(); } function StartHangman(NewWord,WordNum){ var Output = TableOpener; var Blank = ""; /* Start again, if all words are guessed */ if (WordNum == Hangman.length){ WordNum = (Hangman.length-1); CurrentWord = (Hangman.length-1); GameEnd = true; } /* Choose a new word, if wanted and */ if (NewWord == true){ /* Set the images to zero */ CurrentPicture = 0; /* Set Finished to false */ Finished = false; /* Set the Number of correct/wrong letters to zero */ CorrectLetters = 0; WrongLetters = 0; /* Write the instructions to the feedback */ WriteFeedback(Instructions); /* Delete the LettersToGuess-Array and set it to zero */ if (LettersToGuess.length > 0){ LettersToGuess.length = 0; } /* Create the Array where to store the used letters and set the content to zero */ for (var i=0; i "; } else{ // if the letter is guessed, display it Output += " " + LettersToGuess[i][0] + " "; } } } if (Finished == true){ if (LettersToGuess[i][1] == 0){ Output += " " + LettersToGuess[i][0] + " "; } else if (LettersToGuess[i][1] == 1){ if (LettersToGuess[i][0] == " "){ //check whether there's a space in the word Output += " " + Spaces + " "; } else{ // if the letter was guessed display it Output += " " + LettersToGuess[i][0] + " "; } } } } Output += ""; Output += ""; /* Create the image-area */ Output += ""; Output += "
"; Output += ""; /* Add the space for the hint, or the hint itself */ if (Hangman[WordNum][2] == 0){ Output += "
"; } else if (Hangman[WordNum][2] == 1){ Output += Hangman[WordNum][1]; } /* Add the Hint Button or if the word is guessed, add the Next-Word Button */ /* or no button (if the hint was asked for already) */ if ((Finished == true)&&(GameEnd == false)){ Output += NextWordButton; Output = ReplaceStuff("[WordNum]", WordNum, Output); } else{ if ((Hangman[WordNum][2] == 0)&&(Hangman[WordNum][1] != "")){ Output += HintButton; Output = ReplaceStuff("[WordNum]", WordNum, Output); } else{ Output += ""; } } Output += ""; /* Add the Letter-Arrays */ Output += CreateLetterArray(i,WordNum); Output += ""; /* Finish the Display-Grid */ Output += TableCloser; DisplayHangman(Output); DisplayImage(CurrentPicture); } function ShowHint(id){ HangmanFrame.document.getElementById("Hint").innerHTML = Hangman[id][1]; if (Hangman[id][2] == 0){ CurrentPicture++; Hangman[id][2] = 1; } DisplayImage(CurrentPicture); StartHangman(false,id); } function CheckLetter(WordNum,Letter){ var Output = ""; var Guess = false; window.status=" "; /* Save the guessed letter in the UsedLetters */ UsedLetters[Letter] = Letters.charAt(Letter); /* Check wether the guessed letter is correct */ for (var i=0; i 5){ Output += "
" + Lost; /* ... add the score, if the word is guessed */ if (Scoring == true){ Output += "
" + YourScore + " " + CalculateScore(WordNum) + " %"; } } WriteFeedback(Output); } function CalculateScore(WordNum){ var MaxScore = 100; var Score = 0; var Penalty = 0; /* Get the penalty */ if (Hangman[WordNum][2] == 1){ MaxScore = Math.floor(MaxScore/2); } /* Calculate the points for wrong used letters */ /* Get the number of spaces included in the word */ var Spaces = 0; for (var i=0; i 6){ Num = 6; } else{ Num = num; } var Picture = ""; HangmanFrame.document.getElementById("Hangman").innerHTML = Picture; } function StartUp(){ Shuffle(Hangman); PreloadImages(); StartHangman(true,CurrentWord); } function DoNothing(){ } function Blank(){ return "© Michael Rottmeier. Loading ..."; } Sorry, this pages uses frames and your browser does not support frames.<br> Please get a browser supporting frames, eg. Netscape Navigator 6.0+ or Internet Explorer 5.5+.