You will now have the code editor ready to use, so let’s set an image for the start of the game. Drag a show leds box across into the start block.
We are going to shake the Micro:bit to tell it to choose between Rock, Paper and Scissors, so find and on shake block. Inside that we need to set a variable to a random number between 0 and 2 (remember variables from our Scratch projects).
Depending on which number was chosen we want to show a different image. A 0 is going to be a Rock, so we need an if-then-else block. Look in the logic section to find a way to compare the variable (item) with 0, and then draw a picture of a Rock in a show leds block.
We are still left with two more options, Paper or Scissors, so we need to have another if-then-else block in the else part of the block we’ve just added. This time we will check to see if item is 1 and draw a picture of a piece of Paper.
There are only 3 options, so for our simple project we can assume that if it isn’t Rock or Paper then it must be Scissors (with bigger projects be careful about making assumptions!), so put a show leds block in with an image of some scissors.
To finish off we need to wait for a while to see which item has been chosen and then reset the image to the one we used at the start – why do you think that is a good idea?
Once you’ve tested your project try clicking on the Javascript {} button at the top. This is the same project, but showing the Javascript code behind the blocks.