The timer
Section 12: Operators and timeLesson 12.2 · ⏱ 6 min
timer is a clock that counts the seconds since the program started, and reset timer puts it back to zero. wait until waits until the condition is true.



📌 Another example: a reaction-time game
Robo resets the timer, then waits for space. When you press it he says how many seconds have passed: that's your reaction time.



✍️ Practise
Make Robo say “Faster!” if 3 seconds pass and you haven't pressed space.
✍️ Practise here in the lesson✖ Close the labor open the lab in a new page ↗
🎯 Challenge yourself
Easy
Robo says “One second”, then “Two seconds”, then “Three seconds ⏱” at the right time, with wait until timer > …
👀 Show the solution🙈 Hide the solution


Medium
Robo spins without stopping, and a second script stops everything after 3 seconds.
👀 Show the solution🙈 Hide the solution



Hard
The “exactly 5 seconds” game: if you press space with the timer between 4.5 and 5.5 he says “Well done! 🎯”, else he says how much time passed. (and)
👀 Show the solution🙈 Hide the solution



