On this page, you will practice debugging, and you will make the computer give players hints.
number guessing gameblock. It has a bug—an error in the code that makes the program behave differently than expected. This code, if you keep playing over and over, will mostly work, but sometimes (not often) it will congratulate you before you even guess.
Analyze the code, explain how this can happen, fix the bug, and save the project.
Have it pick its random number just from 1 to 3 to make the bug occur more often.
If you want to add more script variables, use the right-pointing triangle. (The left triangle will remove them.)
Jerry Lawson (1940-2011) was an American electronic engineer and gaming pioneer who is dubbed the "father of the video game cartridge." Born in New York City, Jerry took classes at both Queens College and City College of New York. While working as a Chief Hardware Engineer at Fairchild Semiconductor, he led the development of the Channel F console and pioneered the technology of the video game cartridge, which was popularized with the Atari 2600.
The script variable secret number exists only until the script finishes running. When the game is played again, the program will create a new secret number variable and give it a new random number.
In a later unit, you will teach the computer how to guess a secret number that you have chosen.