More turtle challenges
Random Polygons
Take the random square example from this page and change it so that it draws polygons of a random side number (between 3 and 12) |
Versatile Square
This square function is centred on the current turtle position. We save the current turtle position before we start drawing def square(size): Then lift the pen up, move half of the size value across, turn right and move half of the size value down. That should put us at a corner. Turn right again and draw the square normally. When it's done, return to the home position using
turtle.goto(oldx,oldy) |