Pignumbers: Improved Number Guessing Game

Hi there! I just finished “CS101: Intro to Programming” and wanted to share my terminal game project. I had a lot of fun doing it and I’d love to hear some feedback/ideas if anyone would like to give it a go! :slight_smile:

What is it?
It’s an improved version of the “guess what number I’m thinking” game. I added a few things:

  • 5 different difficulties
  • Hint mode (that tells you if the answer is higher or lower)
  • Locally-saved scoreboard & preferences

Playing on the hardest difficulty with ‘Hint Mode: ON’ makes things a little more fun.

Link to the repo & code is here: GitHub - guillaumepeyre/game1-pignumbers

… Back to working on another one… Blackjack! Thanks and let me know if you have any feedback/questions.

Hey Byteace,

I played a few rounds of your game ~ 500+ lines of code, wow!! “Impressive, most impressive
The “pig-theme” to the game was original. I was more impressed with your GitHub presentation. Your code looks great, however, although you have good comments, the code is a bit disorganized, and difficult to read.

As far as recommendations, consider organizing your file where you put classes and functions in a separate files, and import them into a main.py file. For example, consider the following project file structure:

├─ main.py  
├─ game.py   (this is the game subclass)
├─ game_settings.py   (this is the GameSettings class)
├─ game_functions.py  (all the rest of the game functions)

This way, your code will be better organized and easier to manage. You can break your 500 + line of code into easier-to-mage-modules. Does that make sense?

Other than that, this is great code; something to be proud of! Looking forward to your next creation!

Best regards,

Hey seraph776,

Thanks so much for your feedback!! :slight_smile:
It totally makes sense, and I’ll be updating the structure shortly.