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")
snow.go_to(100, 75)
greeting = codesters.Text("Happy Holidays!")
greeting.go_to(0, 200)
greeting.set_color("yellow")
t = codesters.Teacher()
try:
tval1 = t.find_block('def')[0][1]
except:
tval1 = "DNE"
try:
params = t.find_function('say')
tval2a = params[0][1].lower()
tval2b = t.get_indent_at_line(params[0][0])
except:
tval2a = "DNE"
tval2b = "DNE"
t1 = TestObjective()
t1.add_success('click' in tval1, "Great job!")
t1.add_failure('click' not in tval1, "Did you add a Click event?")
t1.add_failure(tval1 == "DNE" or tval1 == None, "Did you add a Click event?")
t2 = TestObjective()
t2.add_success('i hope your holidays are great' in tval2a and tval2b == 4, "Great job!")
t2.add_failure("hello, name" in tval2a, "Did you change the text in the Say command?")
t2.add_failure(tval2b != 4, "Make sure you Say command is indented four spaces inside the Click event.")
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)