The SubmitGuess() problem

So the changes we made to SubmitGuess() I THOUGHT were to removed the underlying problem. My understanding was that the underlying problem was the giant error message would appear when we didn’t enter the proper wordlength. We sort of sidestepped that issue with the enum and error checking code we added, but it seemed like the lecturer was implying that we could fix the issue from the root of the problem which was in submitguess().

What I’m getting at is, all we did within SubmitGuess() was rename so variables. Which doesn’t solve the giant error you get when you type in the wrong word length. If you comment out the error checking code the problem still appears.

Is there a way to remove the bug entirely, in other words, if there was no error checking code, could we allow the user to input a guess which was the wrong length?

1 Like

Hello @John_blah_blah_blah,

I though you might thinking of a keyboard-listener. To avoid the error-checking cycles that are checking the input from the user, then you can use keyboard-listener. A listener will only lowercase and non-special characters allowed to be typed in.

The keyword is “listener”, google for it. This is a huge subject, and will surely covered later by this course.

Cheers
Kevin

Privacy & Terms