# based on https://www.raspberrypi.org/learning/sense-hat-marble-maze/worksheet/

from sense_hat import SenseHat
import time

sense = SenseHat()
sense.clear()

time.sleep(0.5)

r = (255, 0, 0 )
b = (0,0,0)
w = (255, 255, 255 )

x = 1
y = 1

maze = [[r,r,r,r,r,r,r,r],
        [r,b,b,b,b,b,b,r],
        [r,r,r,b,r,b,b,r],
        [r,b,r,b,r,r,r,r],
        [r,b,b,b,b,b,b,r],
        [r,b,r,r,r,r,b,r],
        [r,b,b,r,b,b,b,r],
        [r,r,r,r,r,r,r,r]]

sense.set_pixels(sum(maze,[]))

game_over = False

while not game_over:
    maze[y][x] = w
    sense.set_pixels(sum(maze,[]))

@@ -455,79 +455,355 @@
 %5D%5D%0A%0A
-sense.set_pixels(sum(maze,%5B%5D))%0A%0Agame_over = False%0A%0Awhile not game_over:
+def move_marble(pitch, roll, x, y):%0A    new_x = x%0A    new_y = y%0A    if 1 %3C pitch %3C 179:%0A        new_x -= 1%0A    elif 359 %3E pitch %3E 181:%0A        new_x += 1%0A    return new_x, new_y%0A%0Agame_over = False%0A%0Awhile not game_over:%0A    pitch = sense.get_orientation()%5B'pitch'%5D%0A    roll = sense.get_orientation()%5B'roll'%5D%0A    x,y = move_marble(pitch, roll, x, y)
 %0A   
@@ -853,8 +853,9 @@
 ze,%5B%5D))%0A
+%0A

Add moving of marble on x axis - currently brokwn