Something you should consider is checking for valid input. I found that if I entered a number outside of the range or an alpha character, the program still decremented the number of guesses. In this case I'd expect the game to tell me I entered invalid input and give me the opportunity to try again without losing one of my guesses.