Hello I finished my Code Academy: Python Terminal Game. I would like to get some feedback if possible! Thank you in advance here is a repo of my work => GitHub - MansillaM/CodeAcademyNumberGuessingGame
I think it was very creative to add difficulty levels to the number guessing game. Great job!
Some areas to consider:
- Enclose the game in a
whileloop for continuous play
- Improve on
error handling. For example, the game shouldn’t terminate if the user types a wrong input.
- Improve ways to eliminate
user_inputerror! For example, typing the case
sensitive levelsis prone to errors.
Don’t repeat yourself (
DRY) which is a principle that aimed at reducing repetition of software patterns. You repeat the same lines of code for each difficulty level. Consider writing the program where each level uses the code block of code. You could literally cut at least
100lines code from this program.
- Try to
modularizationyour program to make it easier to read, and manage . For example, break your code into separate functions such as
- Add comments ~ It’s important to add comments to help communicate your ideas to other developers reading your code.
Other than that, I think you did a really great job! I hope you do not mind, I refactored your code to give you an idea of what you could do with your project. There may be some glitches. Please feel free to use the code as you wish, and make it better. If you have any questions, feel free to ask.
Hey thank you so much for your time. I noted everything you wrote, i will try to rework it make it more efficient! Your link isn’t working to see how you refactored it but again thank you for taking the time to check my work and give feedback!!!
I apologize for the broken link. Try my Github. If you have any further questions please feel free to ask.
Hello I looked at the code and yes I understand what you mean! Less lines of code and seperate them (call them) in functions. Love it!