Created
January 30, 2017 15:39
-
-
Save ntoll/12c91fc26546b61b946cf178487c840c to your computer and use it in GitHub Desktop.
Rock, paper, scissors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from microbit import accelerometer, display, Image, sleep | |
import random | |
pictures = [ | |
Image('55555:55555:55555:55555:55555'), # Rock | |
Image('50005:05050:00500:55055:55055'), # Scissors | |
Image('55500:50050:50005:50005:55555'), # Paper | |
] | |
while True: | |
sleep(100) | |
if accelerometer.was_gesture("shake"): | |
display.show(random.choice(pictures)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment