Fixes and Changes #1

Merged
wholesomedonut merged 3 commits from timemachine/pystermind:master into master 2020-09-15 19:30:23 +00:00

3 Commits

Author SHA1 Message Date
Pilot 894dd6df84 Changed the alignment of the output messages. 2020-09-15 14:44:38 -04:00
Pilot 80e36e4aa5 Silly responses for failed attempts
- This is over engineered, I was just trying out an idea
 - MessageTable implements a Random Distribution System
 - Changed the alignment of the output messages to lineup.
2020-09-15 14:39:17 -04:00
Pilot 30f54f438f Updates some control flow issues.
- Updates `calc` to return if the user won.
     - We can then look at the status (win) and continue the loop
     instead of falling through to the "Try again?..." section.
 - Adds continuation after a caught error to prevent the secret from
 resetting
 - Empties the `secret` before regenerating it.
     - `generateSecret() appends to the secret so the second game had a
     len(secret) of 8
     - This caused the compare function to out of bounds on the `guess`
     array.
 - Changed the output formatting of the hit to help readability.

 - Some ideas
     - setting a variable to a length of 4 and referencing that in
     generateSecret, checkGuess, and compare would allow changing the
     difficulty, example:
        - Easy: length 5
        - Medium: length 6
        - Hard: length 8
     - Ask the user for a difficulty before the start of the game.
2020-09-15 11:14:50 -04:00