Lesson 28 · State machine
✓ You already watched this lesson
A traffic light doesn't ask a question; it has a state, and what it does depends on which of the three it's in. That's a state machine, and it's everywhere.
🎯 The challenge of this lesson
Add a fourth case, worth three, that sets the output to forty; then remove the If none and see what the program answers with a state that isn't in any branch.
Read the written page for this lesson →
Stuck on this lesson?
Write your question and another student — or the teacher — will answer. Your email is never published: it is only used to let you know when someone replies.
- Loading the questions…