So far, the programs you’ve seen have been linear—each statement executes, in order, from top to bottom. However, to create interesting games, you need to write programs that execute (or skip) sections of code based on some condition. That’s the main topic of this chapter. Specifically, you’ll learn to:
Understand truth (as C++ defines it)
if statements to branch to sections of code
switch statements to select a section of code to execute
do loops to repeat sections ...