Using argparse module to parse commandline arguments#5
Using argparse module to parse commandline arguments#5DeepSpace2 wants to merge 2 commits intoklipspringr:mainfrom
Conversation
| solution = cli_args.solution | ||
| player.warn(f"Solution will be {solution}") | ||
|
|
||
| else: |
There was a problem hiding this comment.
This is likely out of scope for this PR, but since you're touching this code anyway. What are your thoughts on dropping --today and making it the default and adding --random. Everyone I've shown this project to have all had the same expectation that just starting this app up should give you today's wordle not a random wordle.
This would be an api change of course and would warrant a "major version release" of sorts :)
There was a problem hiding this comment.
I definitely agree. I'll make this change.
There was a problem hiding this comment.
I can understand that expectation, and if I started again I'd probably make this the default. Equally, the original audience for this was MetaFilter users who had already played the day's official game online and wanted more.
I think as society has probably reached Peak Wordle, at this point I'll only change existing user-facing API/behaviour if it's actually broken.
|
So, I should definitely have been using argparse from the beginning -- this PR is much nicer than my manual effort! Thank you for the contribution! However this PR changes the usage from I have gone ahead and fixed (855b58) the bug you reported re allowing unguessable solutions (thanks!). I think it's fine to allow a fixed solution that is not in the official solutions list -- it just has to be in the guesses list. |
Hi! nice side project :)
I've created this PR to introduce the usage of the built-in argparse module to handle commandline arguments instead of manually parsing
sys.argv.I also fixed a small bug in the current implementation that allowed the usage of
--solutionflag to create a game with a non-guessable solution (for example, you could create a game usingabcdeas a solution, but could never guess it),