Skip to content

Conversation

@mtrich
Copy link
Owner

@mtrich mtrich commented Oct 30, 2018

…or scissors

catch(Exception) {

Console.WriteLine("Invalid move entered please try again");
hand1 = Console.ReadLine().ToLower();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is will work, but its a little less elegant the way you have it written. You are doing the check 2 times for valid input. Once for they condition to throw an exception, and once for the condition to check if there is a valid hand so you can keep asking for input.

Also, the way you have it, a do/While loop would fit better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants