I didn't read the code, but I'll offer some observations and leave it to you to research and advance your familiarity with the language. There are char manipulators called "tolower ()" and "toupper ()". There is a "strlen ()" function. If the length of an input string is outside of one's desired bounds, one merely detects that and rejects the input (being careful to clear any other extraneous trash from the input buffer). There are additional library functions which allow one to characterize the text: functions such as isalpha (); isdigit (); isprint (); isspace (). Try incorporating some of that into your game.