Skip to the content.

random counter program

When you press the A button, this program sets variable X to a random number between 2 and 6, sets variable Y to zero, and then displays the value of variable X. Each time you press the B button, the value of variable Y is increased by one. When the value of variable Y becomes equal to the value of variable X, a smiley face is shown.