crwdns360012:0crwdne360012:0
crwdns360014:0crwdne360014:0
crwdns360016:0crwdne360016:0 crwdns360018:0crwdne360018:0 crwdns360020:0crwdne360020:0
crwdns360022:0crwdne360022:0
crwdns360028:0crwdne360028:0
crwdns360030:0crwdne360030:0 crwdns360032:0crwdne360032:0
crwdns360034:0crwdne360034:0
- crwdns360036:0crwdne360036:0
- crwdns360038:0crwdne360038:0
- crwdns360040:0crwdne360040:0
- crwdns360042:0crwdne360042:0 crwdns360044:0crwdne360044:0 crwdns360046:0crwdne360046:0 crwdns360048:0crwdne360048:0 crwdns360050:0crwdne360050:0
- crwdns360052:0crwdne360052:0 crwdns360054:0crwdne360054:0
crwdns360056:0crwdne360056:0
- crwdns360058:0crwdne360058:0
- crwdns360060:0crwdne360060:0
- crwdns360062:0crwdne360062:0
crwdns360064:0crwdne360064:0
1# Imports go at the top
2from microbit import *
3import random
4
5adjectives = ['beautiful',
6 'delicate',
7 'bright']
8
9nouns = ['bird',
10 'butterfly',
11 'dragonfly']
12
13verbs = ['eats',
14 'flies',
15 'flutters']
16
17adverbs = ['swiftly',
18 'silently',
19 'skillfully']
20
21while True:
22 if accelerometer.was_gesture('shake'):
23 choice = random.randint(0, len(adjectives)-1)
24 display.scroll(adjectives[choice])
25 choice = random.randint(0, len(nouns)-1)
26 display.scroll(nouns[choice])
27 choice = random.randint(0, len(verbs)-1)
28 display.scroll(verbs[choice])
29 choice = random.randint(0, len(adverbs)-1)
30 display.scroll(adverbs[choice])
crwdns360066:0crwdne360066:0
- crwdns360068:0crwdne360068:0
- crwdns360070:0crwdne360070:0
- crwdns360072:0crwdne360072:0
This content is published under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) licence.