4USING VARIABLES

image

Have you ever wanted to be a doctor, astronaut, firefighter, animator, mayor, botanist, or ninja? What if you could be all of them but just one at a time? A variable can be anything in your programs, like a string or a number, but it can only be one thing at a time. For example, a number-guessing game might ask the player to enter their name (a string) and then greet the player using that name. Next, the program might ask them to enter their first guess for the game (a number) and then check to see if they guessed correctly.

For the game to work, it must remember, or store, the data entered by the player. It also might need to ...

Get Learn to Program with Small Basic now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.