I'm 13 years old and have been learning C++ for a few weeks! I just finished building my first console-based number guessing game where players can choose from Easy, Medium, or Hard difficulty levels. It handles input in a case-insensitive manner, allows for replaying, and uses random number generation. Although it's just a small project, I aimed for clean structure and made use of the Standard Template Library where possible. I would love to get your feedback on my:
- Code structure
- Areas for improvement
- Any bad practices I might have overlooked
If you're interested, you can check out my GitHub repository here: https://github.com/Minato-Shadow/My-Coding-Journey. Thanks a lot!
5 Answers
Hey! Your project is impressive for someone your age! Your code looks solid and it's nice to see it function as intended. One tip: consider refactoring parts of your code to remove duplication. For instance, in your difficulty settings, it helps to consolidate repeated lines, like the random number generation based on max_num. Keep practicing, you're doing great!
Good job on creating this game! Just a heads up, while you want to document your code, remember that it's best to explain 'why' you did something, rather than what the code does—since that's usually clear from the code itself. Plus, maybe spruce up your README file a bit; it seems a little generic right now. Keep at it!
I appreciate the feedback! I’ll work on updating my README.
Nice work with your game! Make sure to handle any edge cases in your input; for example, ensure you're checking that the user enters valid numbers. It might also be helpful to learn about testing practices and continuous integration. This will give your project a professional touch!
I’ll look into that for sure, thanks!
Great start! Quick note: in your code, avoid using 'magic numbers'. For example, if you'd like to change the number of tries for difficulties, store those numbers in constants. This makes your code cleaner and easier to maintain. Keep pushing yourself and you'll keep improving!
Thanks for this tip! I'll definitely implement constants!
Awesome work getting into programming at such a young age! Just a tip: avoid falling into the trap of relying too much on tutorials. Try to tackle projects independently and use online resources as a backup when you hit roadblocks. That's how you'll really learn! Good luck with your future coding adventures!
Thank you for the encouragement!

Thanks for the suggestion! I'll definitely consider that.