Write a Python program called guess.py that plays a guessing game for a number between a -m|--min and -x|--max value (default 1 and 50, respectively) with a limited number of -g|--guesses (default 5). Complain if either --min or --guesses is less than 1. Accept a -s|--seed for random.seed. If the user guesses something that is not a number, complain about it.
The game is intended to actually be interactive, which makes it difficult to test. Here is how it should look in interactive mode:
$ ./guess.py -s 1
Guess a number between 1 and 50 (q to quit): 25
"25" is too high.
Guess a number between 1 and 50 (q to quit): foo
"foo" is not a number.
Guess a number between 1 and 50 (q to quit): 12
"12" is too high.
Guess a number between 1 and 50 (q to quit): 6
"6" is too low.
Guess a number between 1 and 50 (q to quit): 9
"9" is correct. You win!
Because I want to be able to write a test for this, I also want the program to accept an -i|--inputs option so that the game can also be played exactly the same but without the prompts for input:
$ ./guess.py -s 1 -i 25 foo 12 6 9
"25" is too high.
"foo" is not a number.
"12" is too high.
"6" is too low.
"9" is correct. You win!
You should be able to handle this in your inifinite game loop.
