Maze Game
IF this... THEN that... ELSE something else
Year 7 Computer Science — Conditionals & Flowcharts
Reading a Flowchart
Flowchart: "Is it raining?"
→ YES: Take umbrella → Leave the house
→ NO: Wear sunglasses → Leave the house
◇ Diamond
Decision (Yes/No)
The Diamond Rule
Every diamond has exactly TWO exits:
◇ Is key = True?
├── YES → cross the bridge
└── NO → go back to start of row
A diamond = one IF/ELSE statement.
One question. Two possible paths.
Maze Rules
- Navigate from START (A1) to EXIT (E5)
- Move UP, DOWN, LEFT, or RIGHT — one square per turn
- On each square: flip the trigger card and follow its rule
- Starting values: SCORE=0, HEALTH=10, KEY=False
- While playing: write the IF/ELSE for each card on your flowchart worksheet
Trigger Card Example
You land on a square. The card reads:
TRAP SQUARE
IF key = True:
skip trap safely
ELSE:
health = health - 3
Write this as a diamond in your flowchart!
PLAY!
Navigate the maze. Flip trigger cards. Follow the rules.
Write IF/ELSE notation for each card on your flowchart worksheet.
Now Draw It
Convert your maze journey into a complete flowchart:
- Start with the START oval
- Add a diamond for every trigger card that had an IF/ELSE
- Connect both YES and NO branches
- End with the EXIT oval
Discussion
- What is an IF without an ELSE? What happens when the condition is false?
- Can a diamond have three exits? Why or why not?
- What would an IF inside another IF look like as a flowchart?
Key Takeaway
IF/ELSE creates decision points.
The program asks a yes/no question and takes a different path depending on the answer.
Every diamond in a flowchart is one IF statement.
1 / 9
← → or click to advance