What does state mean?
What a program is currently doing, held in a variable so that each tick of the loop can behave differently: searching, approaching, returning.
In a lesson
Wandering has no plan. A patrol has one: go up, then right, then left, then down. The way a behaviour holds a plan is a state: one word that says which part of the plan you are in. Each tick does the right thing for the current state and checks whether it is time to change.
Learn it
- Taught in 5.2 States Behaviours, Robot club
Used in
- F5.7 Bubble sort
- F8.1 Bits, bytes and units
- F8.5 Negative numbers: two's complement
- F9.7 Secondary storage
- F11.8 Writing secure programs
- F13.1 How your exam works
- F13.2 Trace tables
- 5.4 Priorities
- 5.5 Brains
- 5.6 Project: rescue
and 78 more lessons.
Do the lesson in the simulator