Skip to the content.

24 7 clap MicroCode program

Clap as many times as you can in 7 seconds, but no more than 24 times… that’s the game and it will make you crazy.

The game has 3 pages: page 1 is for clapping, page 2 is victory and score, page 3 is game over.

page 1 page 1

24 7 clap page 1

Setup

The first 3 rules setup the game environment.

when start, play sound hello

when start, set variable X to 1

when start, show clap images and repeat

Clapping

The 4th rule increments the variable X when a clap is detected.

when sound loud, set variable X to variable X + 1

Transitions

The last two rules handle transitioning to winning or loosing state.

when timer 7s, switch to page 2

when variable X changed to 25, switch to page 3

page 2 page 2

24 7 clap page 2

The 7 second expired and the player clapped 24 or less times, show score and switch back to page 1 after 10 seconds.

page 3 page 3

24 7 clap page 3

The player clapped too many times, show game over animation and switch back to page 1.