daily pastebin goal
84%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from microbit import *
  2. import music
  3.  
  4. x = 0
  5. y = 0
  6. while True:
  7.   display.set_pixel(x, y, 9)
  8.  
  9.   if x == 4 and y == 4:
  10.     music.play(music.POWER_UP)
  11.     display.clear()
  12.     x = 0
  13.     y = 0
  14.    
  15.   if button_a.was_pressed():
  16.     x = x + 1
  17.     if x > 4:
  18.       x = 4
  19.  
  20.   if button_b.was_pressed():
  21.     y = y + 1
  22.     if y > 4:
  23.       y = 4
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top