# sprite = codesters.Rectangle(x, y, width, height, "color")
start = codesters.Rectangle(0, -250, 500, 50, "red")
# sprite = codesters.Rectangle(x, y, width, height, "color")
finish = codesters.Rectangle(0, 250, 500, 50, "green")
my_list = [-150, -50, 50, 150]
for value in my_list:
pass # delete after adding indented code
# add code here
# sprite = codesters.Rectangle(x, y, width, height, "color")
sprite = codesters.Rectangle(0, value, 500, 50, "gray")
# sprite = codesters.Sprite("image", x, y)
sprite = codesters.Sprite("turtle1", 0, -240)
sprite.set_size(.2)
sprite.turn_left(90)
t = codesters.Teacher()
functions = t.find_block("def")
interval_handlers = t.find_function("event_interval")
try:
tval1 = functions[0][1].lower().replace(' ','')
except:
tval1 = "DNE"
try:
tval2 = interval_handlers[0][1].lower().replace(' ','')
except:
tval2 = "DNE"
t1 = TestObjective()
t1.add_success('definterval():' in tval1, "Great Job!")
t1.add_failure(tval1 == "DNE", "Did you add an Interval Event at the bottom?")
t1.add_failure(tval1 != "DNE" and 'definterval():' not in tval1, "Are you sure you added an Interval Event?")
t2 = TestObjective()
t2.add_success('.5)' in tval2, "Great job!")
t2.add_failure(tval2 == "DNE", "Oops, did you delete the event handler?")
t2.add_failure(tval2 != "DNE" and '.5)' not in tval2, "Did you change the interval frequency from 2 to 0.5?")
tester = TestManager()
tester.add_test_list([t1, t2])
tester.run_tests()
tester.display_first_feedback()