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
Your tests check that my safeUserInput() function should return "Char". My idea was to return Char nullable because this way I could return null if the input was incorrect, check for null in the main playGame() cycle and interrupt the current iteration with continue, so that if the input is incorrect I could increase the number of attemtps. But I cannot do this (at least I couldn't find any neat way to do this) if safeUserInput() has to return Char and for that recursively run itself in case the input is incorrect. Although it wasn't discussed in the course if I have to treat incorrect inputs as additional attempts or not, I think it would be valid.
The text was updated successfully, but these errors were encountered:
Your tests check that my safeUserInput() function should return "Char". My idea was to return Char nullable because this way I could return null if the input was incorrect, check for null in the main playGame() cycle and interrupt the current iteration with continue, so that if the input is incorrect I could increase the number of attemtps. But I cannot do this (at least I couldn't find any neat way to do this) if safeUserInput() has to return Char and for that recursively run itself in case the input is incorrect. Although it wasn't discussed in the course if I have to treat incorrect inputs as additional attempts or not, I think it would be valid.
The text was updated successfully, but these errors were encountered: