Share your repls and programming experiences

← Back to all posts
My first Python game
Cesar6 (3)

Hey guys, I just made my first Python game.
It might not seem like much but I'm actually proud of it and just wanted to share it with everyone else.

The game

The point of the game is to try and guess what number the computer chose. The difficulty determines the max value the computer can choose. Also, the less tries you take to guess it right, the bigger your score.

The code

I broke down the game into 3 functions, and I feel like the can_be_int(a) and start_game() functions can be easily repurposed for something else.
Also the print("\x1b[2J\x1b[H") lines manage to clear the screen on but not on PyCharm, which is what I use.
I tried to make the game error-proof, but if you find any flaws then please let me know.

I hope you have fun with what I made (most likely during a few seconds or a minute).
Don't be afraid to give me your opinion/feedback!

MagmaCube (1)

You should make a two where one player picks number a and the other player has to guess