Things get more interesting when you let the lines cross by reversing the order on one of the axes. TO STRINGART REPEAT 10 [ PENUP SETXY (REPCOUNT * 10) 0 PENDOWN SETXY 0 (110 - REPCOUNT * 10) ] END Activity: Now it's your turn. Come up with an interesting set of points and connect them using SETXY. For example, try connecting points along a "Y" shape or an "X" shape. You can also take an example that uses FORWARD, BACK, LEFT, and RIGHT and rewrite it to use SETXY, instead. Sample Programs TO CYCLE :INDEX :LAST SETXY :INDEX 0 SETXY :LAST :INDEX SETXY (:LAST - :INDEX) :LAST SETXY 0 (:LAST - :INDEX) SETXY :INDEX 0 END TO SQUAREART REPEAT 10 [ CYCLE REPCOUNT * 10 100 ] END SQUAREART TO CYCLE :INDEX :LAST PENUP SETXY :INDEX 0 PENDOWN SETXY 0 (:LAST - :INDEX) SETXY -:INDEX 0 SETXY 0 (:INDEX - :LAST) SETXY :INDEX 0 END TO PLUSART REPEAT 11 [ CYCLE ((REPCOUNT - 1) * 10) 100 ] END PLUSART TO SPIKEDSQUARE ; left-right lines REPEAT 20 [ HOME SETXY (100) (REPCOUNT * 10 - 110) SETXY (-100) (110 - REPCOUNT * 10) HOME
Things get more interesting when you let the lines cross by reversing the order on one of the axes. TO STRINGART REPEAT 10 [ PENUP SETXY (REPCOUNT * 10) 0 PENDOWN SETXY 0 (110 - REPCOUNT * 10) ] END Activity: Now it's your turn. Come up with an interesting set of points and connect them using SETXY. For example, try connecting points along a "Y" shape or an "X" shape. You can also take an example that uses FORWARD, BACK, LEFT, and RIGHT and rewrite it to use SETXY, instead. Sample Programs TO CYCLE :INDEX :LAST SETXY :INDEX 0 SETXY :LAST :INDEX SETXY (:LAST - :INDEX) :LAST SETXY 0 (:LAST - :INDEX) SETXY :INDEX 0 END TO SQUAREART REPEAT 10 [ CYCLE REPCOUNT * 10 100 ] END SQUAREART TO CYCLE :INDEX :LAST PENUP SETXY :INDEX 0 PENDOWN SETXY 0 (:LAST - :INDEX) SETXY -:INDEX 0 SETXY 0 (:INDEX - :LAST) SETXY :INDEX 0 END TO PLUSART REPEAT 11 [ CYCLE ((REPCOUNT - 1) * 10) 100 ] END PLUSART TO SPIKEDSQUARE ; left-right lines REPEAT 20 [ HOME SETXY (100) (REPCOUNT * 10 - 110) SETXY (-100) (110 - REPCOUNT * 10) HOME
FMSLogo_workshop_tutorials.docx