- Using the program below, run it once and answer the first question
- Press reset on the simulator
- Notice that there's an immediate EOFError scrolling
After this restart doesn't work and stop seems to stop but doesn't show the play button again.
I tried a minimal program using input() and couldn't immediately reproduce it there.
# Imports go at the top
from microbit import *
import random
import music
# Code in a 'while True:' loop repeats forever
print("Welcome to my amazing times table game!")
for question in range(0, 10):
a = random.randint(3, 12)
b = random.randint(3, 12)
while True:
text = input("%s ÷ %s = " % (a * b, b))
try:
guess = int(text)
break
except:
print("That wasn't a number!")
if a == guess:
audio.play(Sound.YAWN)
print("You are awesome")
else:
music.play(music.BADDY)
print("Loser :P")
print()
sleep(1000)
print("All done!")
After this restart doesn't work and stop seems to stop but doesn't show the play button again.
I tried a minimal program using
input()and couldn't immediately reproduce it there.