Last active
July 13, 2021 23:06
-
-
Save ljbelenky/845ceb92207ab3b8b69697538575e2f6 to your computer and use it in GitHub Desktop.
OOP Exercise: Combination Locks
Suggestions for further improvement:
- As Skylar suggested, hash the combination to prevent peeking
- Ensure the user can only enter the code one digit at a time.
- Implement checking to see if the digit entered is allowable (i.e, is a number and within the correct range). Determine how to deal with incorrect input (i.e, raise an error, use a default or coerced value, reject the input without an error, display an error message, etc)
- Expand the number of allowable digits from 0-9 to 0-n.
- Make it send you a text message if someone successfully opens your lock
- Have it send a text message if someone attempts to open the lock X number of times and ask you to enable additional attempts.
Here's one possible solution:
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don't forget to implement a repr.