stage.set_background_color("azure")
sprite = codesters.Sprite("snowman")
sprite.go_to(-125, -62)
choice = sprite.ask("Square or circle?")
choice = choice.lower()
if choice == "square":
sprite.say("square!")
sprite = codesters.Square(0, 0, 62, "green")
if choice == "circle":
sprite.say("circle!")
sprite = codesters.Circle(0, 0, 94, "blue")
t = codesters.Teacher()
ifBlocks = t.find_block("if")
circleFunctions = t.find_function("Circle")
try:
tval1a = ifBlocks[1][1]
tval1b = t.get_indent_at_line(ifBlocks[1][0])
except:
tval1a = "DNE"
tval1b = "DNE"
try:
tval2a = circleFunctions[0][1].lower()
tval2b = t.get_indent_at_line(circleFunctions[0][0])
except:
tval2a = "DNE"
tval2b = "DNE"
t1 = TestObjective()
t1.add_success(tval2b == 4, "Great job debugging the program!")
t1.add_success(tval1a == "DNE" or tval1b == "DNE", "Did you delete the if statement?")
t1.add_failure(tval2a == "DNE" or tval2b == "DNE", 'Did you delete the circle command?')
t1.add_failure(tval2b != 4, "Did you put the circle command inside the if statement?")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()