I have a series of numbers in a table and the user needs to complete the series by entering their guess for the next number.
There is then a submit button that they press to see if they are correct.
If: The guess is too high i want it to display a window.alert saying that "the guess is too high, try again"
If: The guess is too low i want it to display a window.alert saying "the guess is too high, try again"
Else: A window alert saying "Correct!"
Problem is I only want it to allow 5 guesses i was thinking of using the do/while function.
Is this possible?
here is my attempt:
var loop = 0;
if(loop = 10)
window.alert("The number is" + TheNumber)
if (TheGuess > TheNumber)
else if(TheNumber > TheGuess)
loop += 1;
Any suggestions will be greatly appreciated!