# Shake-to-roll dice: a free micro:bit lesson from Maze Education
# https://maze.education/microbit/lessons/dice
# MicroPython for the micro:bit Python Editor: https://python.microbit.org

# Shake-to-roll dice: a random number from 1 to 6 on every shake.
from microbit import *
import random

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