try:
tval1 = sprite.get_x()
tval2 = sprite.get_y()
except:
tval1 = "DNE"
tval2 = "DNE"
if tval1 == 100 and tval2 == 150:
goal.say("")
# text = codesters.Text("Change the numbers in the Go To command to land the triangle's red vertex on the goal!", 0, 225, "blue")
# if tval1 == 100 and tval2 == 150:
# text.set_text("Great job!")
# text.set_color("green")
# elif tval1 == "DNE" or tval2 == "DNE":
# text.set_text("Oops! Did you delete your triangle sprite?")
# text.set_color("red")
# elif tval1 ==150 or tval2 == 100:
# text.set_text("Oops! Did you mix up your x and y coordinates?")
# text.set_color("orange")
# elif tval1 == -100 or tval1 == -150:
# text.set_text("Make sure you count x values to the right of the origin as positive.")
# text.set_color("orange")
# elif tval2 == -150 or tval2 == -100:
# text.set_text("Make sure you count y values above the origin as positive!")
# text.set_color("orange")
# elif tval1 != 100 and tval1 != "DNE":
# text.set_text("Change the numbers in the Go To command to land the triangle's red vertex on the goal!")
# elif tval2 != 150 and tval2 != "DNE":
# text.set_text("Change the numbers in the Go To command to land the triangle's red vertex on the goal!")
# else:
# text.set_text("Change the numbers in the Go To command to land the triangle's red vertex on the goal!")
t1 = TestObjective()
t1.add_success(tval1 == 100 and tval2 == 150, "Great job!")
t1.add_failure(tval1 == "DNE" or tval2 == "DNE", "Oops! Did you delete your triangle sprite?")
t1.add_failure(tval1 ==150 or tval2 == 100, "Oops! Did you mix up your x and y coordinates?")
t1.add_failure(tval1 == -100 or tval1 == -150, "Make sure you count x values to the right of the origin as positive. ")
t1.add_failure(tval2 == -150 or tval2 == -100, "Make sure you count y values above the origin as positive!")
t1.add_failure(tval1 != 100 and tval1 != "DNE", "Change the numbers in the Go To command to land the triangle's red vertex on the goal!")
t1.add_failure(tval2 != 150 and tval2 != "DNE", "Change the numbers in the Go To command to land the triangle's red vertex on the goal!")
tester = TestManager()
tester.display_graphics = False
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.