Imagine you have a picture with some triangles and squares in it:(Draw it)COLOR RED REPEAT 4 DRAW 50 RIGHT 90 NEXT MOVE 70 COLOR GREEN REPEAT 3 DRAW 50 RIGHT 240 NEXT RIGHT 90 MOVE 70 COLOR BLACK REPEAT 4 DRAW 50 RIGHT 90 NEXT ENDIt's simpler to break this program up into objects:
(Draw it)COLOR RED GO SQUARE MOVE 70 COLOR GREEN GO TRIANGLE RIGHT 90 MOVE 70 COLOR BLACK GO SQUARE END # SQUARE REPEAT 4 DRAW 50 RIGHT 90 NEXT RETURN # TRIANGLE REPEAT 3 DRAW 50 RIGHT 240 NEXT RETURN
Now, if you want your squares to be circles instead, you only need to change the code in one place, not two:
(Draw it)# SQUARE REPEAT 36 DRAW 5 RIGHT 10 NEXT RETURN