Create a movie with several turtles moving in each frame, like our dance function. Move each turtle, pause, and save it to a frame.
Note: The easiest way to do this is just to adapt Program 203 to write each frame to a directory.
```
def dance (directory):
return makesquare(directory)
def makesquare (directory):
w = makeWorld()
evenlist = []
oddlist = []
for turtles in range (10):
t = makeTurtle(w)
t.turn(turtles*36)
if turtles % 2 == 0:
evenlist = evenlist + [t]
else:
oddlist = oddlist + [t]
for times in range(20):
for sides in range(5):
if times % 2==0:
for t in evenlist:
t.forward(100)
t.turn(90)
else:
for t in oddlist:
t.forward(100)
t.turn(72)
val = times*5+sides
if val < 10:
writePictureTo(canvas,directory+"//frame00"+str(val)+".jpg")
elif val>=10 and val<100:
writePictureTo(canvas,directory+"//frame0"+str(val)+".jpg")
else:
writePictureTo(canvas,directory+"//frame"+str(val)+".jpg")
movie = makeMovieFromInitialFile(directory+"//frame000.jpg");
return movie
```
You might also like to view...
Write an HTML page that has a button and when you click on the button some text is displayed in the browser status bar.
What will be an ideal response?
What is the purpose of the Layer Collision Matrix?
What will be an ideal response?
A Windows system always halts when a STOP error takes place
Indicate whether the statement is true or false
Before you can share a printer, you need to turn on printer sharing in the ____ window.
A. Network and Sharing Center B. Intranet C. Printers D. Communications Command Panel