30th Jan 2018, 11:20 PM
Jeremy Maillet
Jeremy Maillet - avatar
5 ответов
+ 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 '.
31st Jan 2018, 3:38 AM
Lord Krishna
Lord Krishna - avatar
+ 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")
1st Feb 2018, 5:40 AM
Lord Krishna
Lord Krishna - avatar
+ 2
God, that put my phone in an input loop. 😂 Took me a few tries to guess it. PROCEED WITH CAUTION!!! 👍
31st Jan 2018, 1:36 AM
Dread
Dread - avatar
+ 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 :)
1st Feb 2018, 9:37 PM
Jeremy Maillet
Jeremy Maillet - avatar
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.
31st Jan 2018, 7:21 PM
Jeremy Maillet
Jeremy Maillet - avatar