Open Roberta

Explain to a novice programmer the difference between event and state

Background

We try to showcase the capabilities of the Lab and the robots with interesting programs.

This is a NEPO task, make sure to read the info.

Task

write a program for the Calliope simulator, that

  • sets a counter var to 0
  • in an endless loop, check whether button A is pressed
  • if true, increment the counter, but reset to 0, if 9 is approached

what happens, if you press the button for a long time? How can this "increment loop" avoided?

Deliverables

The program(s). A text to explain the difference between a "button click" and "button is pressed" to a novice programmer.

Task tags

  • nepo
  • advanced
  • simulation

Students who completed this task

Elseif, kiminonawa, Olivia, Blippy, BrendanORAS

Task type

  • code Code
close

2019