Skip to the content.

Rock Paper Scissors icon

Rock Paper Scissors MicroCode program

The classic game of rock paper scissors where the micro:bit display a different symbol when shaken.

The program starts with a rule that uses a shake event and 3-face dice is cast. The result is stored in variable X.

when shake, set variable X to random number up to 3

when shake, play sound hello

The next 3 rules match the value passed in variable X and display a different symbol for each value, 1, 2 or 3.

when variable X changed to 1, paint rock

when variable X changed to 2, paint paper

when variable X changed to 3, paint scissors

improvement ideas

Video