O'Reilly logo

3D Game Programming for Teens, Second Edition by Eric Grebler, Maneesh Sethi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Variables

Variables are intrinsic to almost every program written. A variable is just that: “variable.” This means that the value of a variable can change. For example, say you were running a program that uses a high score that is stored in a variable. When the high score changes, the high score variable changes to reflect the new score.

Declaring Variables

Variables are very easy to use because they can be used as regular numbers. However, unlike numbers, variables must first be declared. When a variable is declared, the program knows that the variable exists, and you can use it in your program.

There are three types of variables in BASIC: integer variables, floating-point variables, and string variables. See Table 2.2 for a description of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required