Make your own free website on Tripod.com
");

	parent.stats.document.write("Total gusses : " + (charPlayed.length-1) + "\n");

	parent.stats.document.write("Wrong gusses : " + moveNumber + "\n");

	parent.stats.document.write("Remaining    : " + (totalMoves-moveNumber) + "
"); if (debug != null) { parent.stats.document.write("Word : " + targetWord + "
"); parent.stats.document.write("Played : " + charPlayed + "
"); } parent.stats.document.write("
"); parent.stats.document.close(); } function gboardUpdate() { var i = 0; parent.gboard.document.close(); parent.gboard.document.open(); parent.gboard.document.write("
"); charFilled = 0; while (i < targetWord.length) { parent.gboard.document.write(""); i ++; } parent.gboard.document.write("
"); if (charPlayed.indexOf(targetWord.charAt(i)) != -1) { charFilled += 1; parent.gboard.document.write(targetWord.charAt(i)); } else parent.gboard.document.write("?"); parent.gboard.document.write("
"); parent.gboard.document.close(); } function grafixUpdate() { } function playChar(c) { if (charPlayed == "" || charPlayed.indexOf(c) == -1) { if (targetWord.indexOf(c) == -1) // Wrong guess moveNumber ++; charPlayed += c; statusUpdate(); gboardUpdate(); grafixUpdate(); window.status = "" + (targetWord.length - charFilled) + " more letters in " + (totalMoves-moveNumber) + " gusses."; if (charFilled == targetWord.length) { alert("Congratulations! You have guessed the word correctly."); startGame(); } else if (moveNumber == totalMoves) { alert("Your 7 turns are over and you have lost. The correct word is " + targetWord +"."); startGame(); } } else window.status = "Already played"; } function startGame() { var i = 0; var j = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; moveNumber = 0; charPlayed = "?"; charFilled = 0; if (lvlChanged == 1) { listIndex = 1; lvlChanged = 0; } selectWord(); statusUpdate(); gboardUpdate(); grafixUpdate(); window.status = "" + (targetWord.length - charFilled) + " more letters in " + (totalMoves-moveNumber) + " gusses."; while (i < 26) { document.board.elements[i].value = " " + j.charAt(i) + " "; i++; } } // -->








Back to main page