MCC: Python: Microbit: Rock, Paper and Scissor

We continued learning python to create rock, paper and scissor game. It involves creating our own images and then making them as list. From that use random to choose one.

from microbit import *
import random

rock = Image('09990:99999:99999:99999:09990')
paper = Image('99990:90090:90090:90990:99900')
scissor = Image('00900:00900:99999:99900:09900')

mylist = [rock,paper,scissor]

while True:
    if accelerometer.is_gesture("shake"):
        display.show(random.choice(mylist))

Leave a comment