Write a function to create a movie where one item is moving in a diagonal line from top left to bottom right and another item is moving from the right to the left.

What will be an ideal response?

```
def movingRectangle5(directory):
for num in range (1 ,30): #29 frames
canvas = makeEmptyPicture (300 ,250)
#add a filled rect moving linearly
addRectFilled(canvas,num*8,num*7,50,50,red)
addRectFilled(canvas,250-num*8 ,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...

To find all states that are not PA, you could enter < >"PA" for the state criteria. The < > is an example of a logical operator

Indicate whether the statement is true or false

Computer Science & Information Technology

The largest WAN in existence is the ____.

A. World Wide Web B. Usenet C. Internet D. client server

Computer Science & Information Technology