Skip to content

Instantly share code, notes, and snippets.

@rudrathegreat
Last active November 23, 2018 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rudrathegreat/f42e1ca01c81ea9973e4653b60c16085 to your computer and use it in GitHub Desktop.
Save rudrathegreat/f42e1ca01c81ea9973e4653b60c16085 to your computer and use it in GitHub Desktop.
Simplified Version of Dice.py
''' This program only works on the
BBC Microbit. If you would like to view
Dice.py, then just use the link below -
https://gist.github.com/rudrathegreat/ed7db24af713ae8d42444bc0816d19c6
'''
from microbit import *
import random
while True:
if accelerometer.was_gesture('shake'):
display.clear()
number = random.randint(1,6)
display.show(str(number))
sleep(2000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment