You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the problem:
So, the whole meaning and purpose of a guessing game is to guess a number and the program will tell whether it is high or low to get to the real number. But, although the current guessing game program is excellent at teaching many basic rust concepts, it is kind of weird that the number being guessed by the user is being changed after each guess before the user can guess it.
I mean suppose the number is 10 and the user enters something like 9, now the program says too small.Here, the user thinks that now he needs to make the guess bigger than 9 and enters something like 10 , which is actually correct, but the program generated a new number after the last input (because the number was created in the last iteration) so user is technically guessing a number without too small and too high hints! Which is guessing a number just like that!
I hope you got what I am trying to say!
Suggested fix:
I know, for a beginner learner current program is simple and serves the purpose of teaching the concepts but we could try to make the program to handle the error by introducing another loop for processing the guessing of the user for that generated number.So, one loop for the main program and one loop for use input.
The text was updated successfully, but these errors were encountered:
Description of the problem:
So, the whole meaning and purpose of a guessing game is to guess a number and the program will tell whether it is high or low to get to the real number. But, although the current guessing game program is excellent at teaching many basic rust concepts, it is kind of weird that the number being guessed by the user is being changed after each guess before the user can guess it.
I mean suppose the number is 10 and the user enters something like 9, now the program says too small.Here, the user thinks that now he needs to make the guess bigger than 9 and enters something like 10 , which is actually correct, but the program generated a new number after the last input (because the number was created in the last iteration) so user is technically guessing a number without too small and too high hints! Which is guessing a number just like that!
I hope you got what I am trying to say!
Suggested fix:
I know, for a beginner learner current program is simple and serves the purpose of teaching the concepts but we could try to make the program to handle the error by introducing another loop for processing the guessing of the user for that generated number.So, one loop for the main program and one loop for use input.
The text was updated successfully, but these errors were encountered: