Created
July 9, 2016 23:14
-
-
Save peschkaj/14cca4165e106494ceedd5d4e8bad861 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void get_user_action(char input[MAX_INPUT_LENGTH]) | |
{ | |
bool validInput = false; | |
do | |
{ | |
cout << HAND_MSG << endl; | |
cin.get(input, MAX_INPUT_LENGTH, '\n'); | |
cin.ignore(100, '\n'); | |
s_to_lower(input); | |
if (strcmp(QUIT, input) == 0 | |
|| strcmp(STAND, input) == 0 | |
|| strcmp(HIT, input) == 0) | |
{ | |
validInput = true; | |
} | |
else | |
{ | |
cout << "'" << input << "' was not recognized." << endl; | |
cin.clear(); | |
} | |
} while (!validInput); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment