Teaching article
An if instruction needs a condition the reader can test
Define a test that selects an action.
Use a visible shape property to choose between two actions. A condition such as has a triangle gives the interpreter evidence to inspect, unlike an undefined judgement such as looks special.
Use a condition that can be decided from the available input. An undefined term such as special makes the branch difficult to execute consistently.
Let the input decide the branch
To hand: Cards marked with shapes.
- State the condition.
- Check one card.
- Follow the matching branch.
If the card has a triangle, place it in tray A; otherwise use tray B.
A condition needs an observable rule. Which evidence selected the branch?
Use two large shape examples.
Resources
- Human Robot Commands – Coding Without Screens Printable Game — Check the command conventions before using the sequence or debugging task.
Further reading
- CS Unplugged — Kidbots and algorithm activities
- Australian Curriculum Version 9 — Technologies overview
Read next
- A sequence follows order; a conditional selects an action
- An ordered card set permits a different search strategy
- Name a command block so it can be reused consistently
Explore Coding and computational thinking. Browse all teaching articles.
