Skip to content

crwdns342183:0crwdne342183:0

crwdns336052:0crwdne336052:0

crwdns347531:0crwdne347531:0 | MakeCode, Python | crwdns255566:0crwdne255566:0, crwdns255578:0crwdne255578:0 | crwdns258472:0crwdne258472:0, crwdns258504:0crwdne258504:0, crwdns258516:0crwdne258516:0, crwdns258562:0crwdne258562:0

crwdns335978:0crwdne335978:0

crwdns335980:0crwdne335980:0

crwdns335982:0crwdne335982:0 crwdns335984:0crwdne335984:0

crwdns335986:0crwdne335986:0

crwdns335992:0crwdne335992:0

crwdns335998:0crwdne335998:0

crwdns336000:0crwdne336000:0

  • crwdns336002:0crwdne336002:0
  • crwdns336004:0crwdne336004:0 crwdns336006:0crwdne336006:0
  • crwdns336008:0crwdne336008:0
  • crwdns336010:0crwdne336010:0 crwdns336012:0crwdne336012:0
  • crwdns336014:0crwdne336014:0 crwdns336016:0crwdne336016:0 crwdns336018:0crwdne336018:0
  • crwdns336020:0crwdne336020:0

crwdns336022:0crwdne336022:0

  • crwdns336024:0crwdne336024:0
  • crwdns336026:0crwdne336026:0
  • crwdns336028:0crwdne336028:0

crwdns342613:0crwdne342613:0

1# Imports go at the top
2
3
4
5from microbit import *
6import random
7
8while True:
9    if accelerometer.was_gesture('shake'):
10        random_number = random.randint(1, 3)
11        if random_number == 1:
12            display.show(Image.ARROW_N)
13        elif random_number == 2:
14            display.show(Image.ARROW_E)
15        else:
16            display.show(Image.ARROW_W)
17    sleep(2000)
18    display.clear()

crwdns342615:0crwdne342615:0

  • crwdns342617:0crwdne342617:0
  • crwdns342619:0crwdne342619:0
  • crwdns342621:0crwdne342621:0

crwdns342623:0crwdne342623:0