O'Reilly logo

Learn to Program with Small Basic by Ed Price, Majed Marji

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

9USING DECISIONS TO MAKE GAMES

image

Sometimes decisions are complicated. Let’s say a boy and a girl want to see a movie. She wants to see an action movie, but he wants to see a comedy. She’s willing to see a comedy if it has action, if it has good reviews, and if it stars an actress she likes. But the movie has to start before 10 PM and must be within a 10-mile radius of the restaurant where the couple is having dinner. Imagine what the code would look like to make a decision like that!

In this chapter, we’ll continue the topic of decision-making and look at some new statements. We’ll first introduce the If/ElseIf statement and show how it makes writing ...

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