Create a movie with boxes growing and shrinking in it.

Note: The easiest solution to this problem is to simply have one box growing and one shrinking. One could instead change from shrinking to growing partway through, but this is not necessary.


```
def boxesMovie(directory):
jane = SadBox ()
joe = Box ()
jane.setSize(70)
jane.setPosition((200,10))
for num in range (1 ,30): #29 frames
canvas = makeEmptyPicture (300 ,250)
numStr=str(num)
joe.grow(2)
jane.grow(-2)
joe.draw(canvas)
jane.draw(canvas)
canvas.show()
if num < 10:
writePictureTo ( canvas , directory +"//frame0 "+ numStr +".jpg ")
if num >= 10:
writePictureTo ( canvas , directory +"//frame "+ numStr +".jpg ")
movie = makeMovieFromInitialFile(directory+"//frame00.jpg");
return movie
```

Computer Science & Information Technology

You might also like to view...

The C++ language system provides access to a large collection of previously written and tested program components that are organized in _________________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The statement variable = variable + newValue; is an example of an accounting statement.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

On average, what is the performance of a sequential search on a singly linked structure?

A. logarithmic B. linear C. exponential D. random

Computer Science & Information Technology

What is the name for a device infected with malware that an attacker uses to control the device remotely?

What will be an ideal response?

Computer Science & Information Technology