from microbit import *
import random

while True:
    if accelerometer.was_gesture("shake"):
        display.show(random.randint(1, 6))
