target = codesters.Sprite("triangle", 100, 100)
target.set_opacity(.5)
target.set_speed(100)
text = codesters.Text('target', 100, 80)
text.set_size(.8)
text.set_opacity(.8)

stage.set_background("grid")
sprite = codesters.Sprite("triangle", -200, -50)

t = codesters.Teacher()
translations = t.find_text('translate')
reflect = t.find_text('reflect')
rotate = t.find_text('rotate')
try:
tval1 = translations[0][1]
except:
tval1 = "DNE"
try:
tval2 = translations[1][1]
except:
tval2 = "DNE"
try:
tval3 = sprite.get_x()
tval4 = sprite.get_y()
except:
tval3 = "DNE"
tval4 = "DNE"
try:
tval5 = len(reflect)
except:
tval5 = "DNE"
try:
tval6 = len(rotate)
except:
tval6 = "DNE"
t1 = TestObjective()
t1.add_success(('x' in tval1 or 'y' in tval1) and ('x' in tval2 or 'y' in tval2) and tval3 == 100 and tval4 == 100 and tval5 == 0 and tval6 == 0, "Great job!")
t1.add_failure(tval1 == "DNE" and tval2 == "DNE", "Try a Geometry Transformation command that maps your sprite to the target!")
t1.add_failure(('x' in tval1 or 'y' in tval1) and tval2 == "DNE", "You may need to use more than one translation command!")
t1.add_failure('x' not in tval1 and 'x' not in tval2, "Use Translate X to move your triangle sideways.")
t1.add_failure('y' not in tval1 and 'y' not in tval2, "Use Translate Y to move your triangle up or down.")
t1.add_failure(tval3 != 100 or tval4 != 100 and tval5 == 0 and tval6 == 0, "Those are the right commands! Adjust the numbers to map your triangle onto the target!")
t2 = TestObjective()
t2.add_failure(tval5 != 0, "Reflections flip shapes over a line. Try a different transformation!")
t2.add_failure(tval6 != 0, "Rotations turn shapes around a point Try a different transformation!")
if tval3 == 100 and tval4 == 100:
text.set_text(' ')
tester = TestManager()
tester.display_graphics = False
tester.add_test_list([t2,t1])
tester.run_tests()
tester.display_first_feedback()