+ 1
what's wrong?
5 Answers
+ 5
What are you expecting of the code?
It is functioning correctly as it should.
1st it asks for the value of x then it writes the value to the document. then it checks if x = A if not then show a message like it is smaller or larger than A '.
+ 5
It's not a bug. It's working just as you wrote the code. If you don't want it to loop continuously change the while statements to if statements; it will prompt just once.
At the moment the code asks for input till you enter the correct answer. Technically you are actually playing until you find the correct answer. if you want add some hints when the number is smaller or bigger in the prompt. like prompt('guess again', "try a bigger number")
+ 2
God, that put my phone in an input loop. đ Took me a few tries to guess it.
PROCEED WITH CAUTION!!! đ
+ 1
i get it! the problem was if you couldnt find after second try, the game stopped, and what i tried to do didnt work properly, i needed to use a fonction actualy, and it works now :)
0
well. it doesnt work properly. first, as Jonathan said, it can turn into an infinite loop bug. then my loop doesnt work correctly. i want to play until i find the good answer.