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 ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.