stage.set_background("winter")
sprite = codesters.Sprite("person12")
sprite.go_to(-125, -150)
frosty = codesters.Sprite("snowman")
frosty.go_to(100, -125)
snow = codesters.Sprite("snowflake3")
t = codesters.Teacher()
try:
tval1 = snow.get_x()
tval1b = snow.get_y()
except:
tval1 = "DNE"
tval1b = "DNE"
try:
tval2 = sprite.get_x()
tval2b = sprite.get_y()
except:
tval2 = "DNE"
tval2b = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == 100, "Great Job!")
t1.add_failure(tval2 == 100 and tval2b == 75 and tval1 != 100 and tval1b != 75, "Make sure you change the name in front of your Go To command to snow.")
t1.add_failure(tval1 == 0 and tval1b == 0, "Did you add a Go To command to the snow sprite?")
t1.add_failure(tval1 == -100, "Did you change the x-coordinate in the Go To command?")
t1.add_failure(tval1 == "DNE", "Did you delete or rename snow?")
t2 = TestObjective()
t2.add_success(tval1b == 75, "Great job!")
t2.add_failure(tval1b == 0, "Did you add a Go To command to the snow sprite?")
t2.add_failure(tval1b == -50, "Did you change the y-coordinate in the Go To command?")
t2.add_failure(tval1b == "DNE", "Did you delete the snow sprite?")
tester = TestManager()
tester.add_test_list([t1, t2])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
Enviar Trabajo
-
Actividad Siguiente
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)