stage.set_background("schoolentrance")
sprite = codesters.Sprite("person10")
sprite.go_to(-125, -100)
emma = codesters.Sprite("person8")
emma.move_down(125)
emma.say("Someone took my phone!")
stage.wait(2)
emma.say("They've been sending people mean texts pretending to be me!")
stage.wait(2)
sprite.say("What should I do?")
t = codesters.Teacher()
try:
tval1 = int(t.get_parameters_for_function('wait')[2][0])
except:
tval1 = "DNE"
try:
tval2 = t.find_function('ask')[0][1].lower().replace(' ', '')
except:
tval2 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == 2, "Great job!")
t1.add_failure(tval1 == "DNE", "Did you add a new Wait command?")
t1.add_creative(tval1 != 2 and tval1 != "DNE", "That's a good amount of wait time, too!")
t2 = TestObjective()
t2.add_success("a)tellatrustedadultb)tellpeopleemmaissendingthemessagesc)ignoreemma" in tval2, "Great job!")
t2.add_failure(tval2 == "DNE", "Did you add an Ask command?")
t2.add_failure("a)tellatrustedadultb)tellpeopleemmaissendingthemessagesc)ignoreemma" not in tval2, "Did you enter all the choices?")
tester = TestManager()
tester.add_test_list([t1, t2])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
提交作品
-
下个活动
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)