Skip to content

Commit 8fc2226

Browse files
committed
Indentation fixes
1 parent adb4958 commit 8fc2226

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

embedded-python/simon_says.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,28 @@
77

88
# While the micro:bit is on
99
while True:
10-
# Pick a random direction
11-
direction = directions[randrange(3)]
12-
display.show(direction)
13-
# Sleep for a second (1000ms)
14-
sleep(1000)
10+
# Pick a random direction
11+
direction = directions[randrange(3)]
12+
display.show(direction)
13+
# Sleep for a second (1000ms)
14+
sleep(1000)
1515

16-
# Get the X-axis (left-right) tilt
17-
acc_x = accelerometer.get_x()
18-
# Determine direction
19-
if acc_x < -200:
20-
user_in = "L"
21-
elif abs(acc_x) < 200:
22-
user_in = "O"
23-
elif acc_x > 200:
24-
user_in = "R"
16+
# Get the X-axis (left-right) tilt
17+
acc_x = accelerometer.get_x()
18+
# Determine direction
19+
if acc_x < -200:
20+
user_in = "L"
21+
elif abs(acc_x) < 200:
22+
user_in = "O"
23+
elif acc_x > 200:
24+
user_in = "R"
2525

26-
# Check win condition
27-
if user_in == direction:
28-
# User input correctly
29-
points += 1
30-
else:
31-
display.scroll(points)
32-
display.show(Image.SAD)
33-
points = 0
34-
sleep(1000)
26+
# Check win condition
27+
if user_in == direction:
28+
# User input correctly
29+
points += 1
30+
else:
31+
display.scroll(points)
32+
display.show(Image.SAD)
33+
points = 0
34+
sleep(1000)

0 commit comments

Comments
 (0)