Write a function to create a movie where one item is moving from the top to the bottom and another item is moving from the bottom to the top.

What will be an ideal response?

```
def movingRectangle3(directory):
for num in range (1 ,30): #29 frames
canvas = makeEmptyPicture (300 ,250)
#add a filled rect moving linearly
addRectFilled(canvas,0,num*7,50,50,red)
addRectFilled(canvas,0 ,200-num*7 ,50,50,blue)
# Now , write out the frame
# Have to deal with single digit vs. double digit
numStr=str(num)
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...

Excel creates charts on the same worksheet as the original data set, but you can ________ the chart to its own chart sheet

Fill in the blank(s) with correct word

Computer Science & Information Technology

Which of the following is false?

a. If a string is converted to a C-style array using data, modifying the string could cause the pointer previously returned by data to become invalid. b. Converting a string containing one or more null characters to a C-style string can cause logic errors. c. c_str returns a character array of the same length as the string object it is called on. d. copy implicitly converts a string to a non-null terminated character array.

Computer Science & Information Technology