Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

This page removed for FERPA compliance
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Fall 2005 Exam Review Answers - Movies

Going to lime green


def movies(dir):
  for frame in range(1, 100):
    bg = makeEmptyPicture(50, 50)
    color = makeColor(0, int(frame * 2.55), 0)
    addRectFilled(bg, 1, 1, 50, 50, color)
    filename = 'frame' + '0' * (frame < 10) + str(frame) + '.jpg'
    writePictureTo(bg, dir + '//' + filename)



Travelling pixel


def movies(dir):
  for frame in range(1, 100):
    bg = makeEmptyPicture(100, 100)
    x = frame
    y = 100 - frame
    addRectFilled(bg, x, y, 1, 1, white)
    filename = 'frame' + '0' * (frame < 10) + str(frame) + '.jpg'
    writePictureTo(bg, dir + '//' + filename)


Link to this Page