PASO 9: Preguntemos al usuario qué palabra de transición usará para ayudar a avanzar la historia. En esta historia, haremos la transición a lo que va a pasar después, así que pediremos una transición de la categoría de secuencia.
Ve a y arrastra afuera Ask.
Cambia choice a transition1. Esto guardará el valor que ingresa el usuario para poder usarlo después.
Cambia el string a "Choose a transition from the sequence category."
To navigate the page using the TAB key, first press ESC to exit the code editor.
stage.set_background("park")
sprite = codesters.Sprite("person3")
sprite.glide_to(-100, 50)
# text = codesters.Text("text", x, y, "color")
text = codesters.Text("I went to the park!", 0, -200, "blue")
stage.wait(1)
sprite.move_right(400)
t = codesters.Teacher()
try:
tval1 = t.find_function('ask')[0][1]
except:
tval1 = "DNE"
t1 = TestObjective()
t1.add_success('transition1' in tval1 and 'choose' in tval1.lower(), "Great job!")
t1.add_failure(tval1 == "DNE", "Did you add an Ask command?")
t1.add_failure('choice' in tval1, "Did you change the variable name choice to transition1?")
t1.add_failure('yes' in tval1.lower(), "Did you change the string in your ask so that the user chooses a transition?")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()
Are you already running a Codesters project in another tab or window?
Micro:bit can only connect to one web page at a time.
Try stopping other Codesters projects or closing
other tabs or windows that may be using your Micro:bit.
If that doesn't fix the problem try disconnecting your Micro:bit,
reloading this page, and reconnecting your Micro:bit.