crwdns258168:0crwdne258168:0
crwdns258170:0crwdne258170:0
crwdns258172:0crwdne258172:0
crwdns258176:0crwdne258176:0
- crwdns258178:0crwdne258178:0
- crwdns258180:0crwdne258180:0
- crwdns258182:0crwdne258182:0
- crwdns258184:0crwdne258184:0 crwdns258186:0crwdne258186:0 crwdns258188:0crwdne258188:0
- crwdns258190:0crwdne258190:0
crwdns258192:0crwdne258192:0
- crwdns258194:0crwdne258194:0
- crwdns258196:0crwdne258196:0
- crwdns258198:0crwdne258198:0
crwdns258200:0crwdne258200:0
1from microbit import *
2import random
3
4while True:
5 gameStarted = False
6 sleep(random.randint(1000, 5000))
7 gameStarted = True
8 display.show(Image.HEART)
9 while gameStarted:
10 if pin1.is_touched():
11 display.show('A')
12 gameStarted = False
13 elif pin2.is_touched():
14 display.show('B')
15 gameStarted = False
16 sleep(3000)
17 display.clear()
18
crwdns258202:0crwdne258202:0
- crwdns258204:0crwdne258204:0
- crwdns258206:0crwdne258206:0
- crwdns258208:0crwdne258208:0
This content is published under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) licence.