September 21st, 2025 Coding project #1 The Number game!
During the past week I’ve been working on a piece of code with the goal of demonstrating a basic understanding and way to use simple coding statements. Throughout this process I’ve had success, failure, and road blocks but in the end produced a piece of code I’m proud of. I used assistance from google gemini in the creation of my project and a link to my chat in a google doc is just below.
https://docs.google.com/document/d/1c7dUjtHHSlJs8PB8FRADFDpH2eKm8l9Qf-JZ_EcIUOI/edit?usp=sharing
I chose to create a number guessing game in which the player would guess a number 1-10 and would be told whether the number was higher or lower than their guess. I executed my idea without any problems in which I found it quite amusing however for a source of entertainment it lacked complexity and became boring quick. I then added a guess counter, and a guess limit while keeping the thought of adding more ways to play in mind. I took the boldest move yet and made an attempt at creating multiple game modes. I first created a hard mode and added different winning lines and after learning it was quite simple I easily made a pro mode. In the end my code reflected a great use of the basic coding statements and accomplished its goal of being a fun entertaining game.
I also created a flow chart to outline the process when tackling a coding problem. The image is below!
Below is an in depth analysis of my code provided through this link
https://colab.research.google.com/drive/1e2GC64BxgIyrPGTSjk7-cj3tSXUu_Agr?usp=sharing

The first block of code goes over my number generation set being “import random”, printed text to open out the game, the ability to chose different modes that affect guesses and number ranges. While true allows us to create a loop for our code continuing to the end. The print line is a basic coding idea in which you type print and it projects text that you put inside the brackets. Below is an if statement and elif statement and an else statement which basically means if you type h run that code, if you type p run that code, and lastly if neither of the others it will run that code. The values below the if/else statements are the guess you get and the number range in which connect to the guessing portion of the code and the number range that is generated.

In this code block in includes the end of the first part showing the text that will be printed if mode = easy and also the higher or lower, and number generator. Line 2-4 work together to generator a random number between 1 and the number range of either 10, 100, or 1000 depending on your mode. line 5 goes over how if guesses used is less than total guesses the game will continue. The next few lines go over how the guess must = an integer for the request on later lines to be processed and that guess used goes up by one each time. Another if statement is used how if the guess equals the generated number than it will go down below and print the winning text but if it is not the secret number being lower or higher the respective texts will be written. Lastly if the guesses left are less than your total guesses than the request to print how many guesses you have left is run.

To start off the last portion of code it covers if not whole numbers and used as an answer, the winning lines for each respective role, losing lines, what the number was, and if you want to play again. If the value is not an error connecting to the previous line then line 2 in this section is printed. If the mode at the start was pro than an original line would be printed with the same for other modes. The else statement below shows that if the number is not guessed that 2 lines will be printed with the second listing the randomly generated number. Lastly an input is asked from the player for whether they want to play again and if the play again input equals yes the game restarts and if it doesn’t represented by the != sign than the text on the last line is printed before the play through ends.
Thank you for taking time out of your day to read my blog post on my coding project, don’t worry if your keen on reading
More blog posts are coming soon!
Leave a Reply to A WordPress Commenter Cancel reply