stage.set_background("winter")
snow()
def snow():
stage.set_bounce(1)
stage.set_gravity(10)
snow_1 = codesters.Sprite("snowflake1", 0, 300)
snow_1.set_y_speed(7)
snow_2 = codesters.Sprite("snowflake2", 150, 300)
snow_2.set_y_speed(3)
snow_3 = codesters.Sprite("snowflake3", -150, 300)
snow_3.set_y_speed(11)
t = codesters.Teacher()
try:
snow_func = t.find_text('snow()')
tval1 = snow_func[1][1]
except:
snow_func = "DNE"
tval1 = "DNE"
try:
snow_func = t.find_text('snow()')
tval2 = snow_func[0][0]
except:
snow_func = "DNE"
tval2 = "DNE"
t1 = TestObjective()
t1.add_success('snow()' in tval1, "Great job debugging the program!")
t1.add_failure(tval2 == "DNE", "Did you delete your function call?")
t1.add_failure(tval1 == "DNE", "Did you delete your function or function call?")
tester = TestManager()
tester.add_test_list([t1])
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)