I had the task to write a program which could use a random number between the 1 and 100 and let the user play a game trying to guess that number. First of all, I had to look for how to print a random number. Honestly I didn’t save the pages where I found the information but if you type it on Google you won’t have any problem finding the libraries and the commands to print a random number.
Then I used a loop, so the user could keep guessing the number that the program had selected as default. Also I used a counter which would tell the user how many times he had tried guessing the number.
Here is a screenshot of how I wrote the program. Also you can find my code on GitHub. Link.
You can see a video of my program working on ScreenCast. Link.
Alex H.
·Pick a number· #WSQ06 by alexhfoo is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.