[B][COLOR=”Red”]hi i cant fix the follwojng. ive built it but its not working now,. did do but then i tried to input code so a box asks to contnue and you press yes to play again and no to finish. can some help me finish it?
code :
<HTML>
<HEAD>
<TITLE>Web Development</TITLE>
<SCRIPT TYPE=”text/javascript” LANGUAGE=”JavaScript”>
<!– Hide Script from old browsers
var game_number, user_number, guess;
var play_again=””;
do
{
// Generate game number
game_number=parseInt(Math.floor(Math.random()*101));
document.write(“New game: Game number generated.<BR>”);
// Get the users first guess
user_number = window.prompt(“Enter your guess (1 through 100), (0 quits the game):”, “”);
guess = parseInt(user_number);
while ((guess != game_number) && (guess != 0))
{
if (guess > game_number)
document.write(“Guess = ” + guess + “. You need to guess lower<BR>”);
else
document.write(“Guess = ” + guess + “. You need to guess higher<BR>”);
// Get the users next guess
user_number = window.prompt(“Enter your guess (1 through 100), (0 quits the game):”, “”);
guess = parseInt(user_number);
}
if (guess == game_number)
{
// User has guessed correctly
window.alert(“You guess correctly!!! ” + guess + ” is the number, well done.”);
play_again = window.prompt(“Do you wish to play again (Y/N):”, “Y”); = window.prompt(“Do you wish to play again (Y/N):”, “Y”);
}
if (play_again==”Y” || play_again==”Y”)
{
document.location=document.location;
} while ((guess != 0) && (play_again == “N”) && (play_again == “n”));
// End Script Hiding –>
</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>