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

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Homework 2- Spring 2008


Due: Monday, February 11th at 11:55 PM



Quick Overview

Your assignment is to write a function that will create a collage of pictures. Your collage will be made by copying at least 3 pictures onto a blank canvas. You must use at least 3 different pictures. When finished, your collage should look like the flag of a country. Please check out the example on this page. Read on for more details....



Details, Details
  1. Your function should be named flag (case sensitive) and your file should be named hw2.py
  2. Your function should take in NO INPUT PARAMETERS
  3. To create your canvas, use the function makeEmptyPicture(x,y), where x and y are numbers. You may make the canvas as big as you would like, however try to keep it as small as possible to elimate excess black space and additionally reduce the time it takes to complete the collage.
  4. All of the images must be modified in some way. Some examples of the modifications you can do for the images include:
    • posterizing
    • negative
    • flipping
    • manpulating the color values
    • etc...
    • Note: Each modification can only be used once.
    • After composing all three modified pictures, they must look like one of these flags. Try to maintain (loosely) the colors of the flags. If you would like to use a different flag, post to the questions page for approval. (See example flags here).
    • You must write at least 2 functions. Some ideas on how you might divide your work include but are not limited to:
      • Write one function for each kind of picture modification and another which copies the modified pictures onto the canvas
    • Your function must get files out of the directory that the media path is set to. To do this you must use setMediaPath() and getMediaPath(). Note: you should not use pickAFile() in your function. Please see the slides/code page (setMediaPath and getMediaPath) or the textbook for more examples on how to use setMediaPath() and getMediaPath().
    • Your function must return the picture when it is done. Do not call show inside the functions that do an image transformation.
    • Then you must post your result to the gallery. You will need to use writePictureTo to save the image onto your computer. Please do not submit code containing the writePictureTo function. Post your image as yourPrismID.jpg. For example: gtg377h.jpg.
    • Finally, submit your code and your pictures to T-square. Remember you must add one file at a time to the list of files to be submitted.




How the TA will grade
Your TA will:
  1. Retrieve your submission from T-square.
  2. Extract that zip file containing your pictures and code.
  3. Put all of your images into a folder.
  4. Set the media path to that folder using setMediaPath().
  5. Open your hw2.py file in JES.
  6. Load your code.
  7. Type show(flag()) into the command area.
  8. Look at your picture.
  9. View the gallery to see that the picture created matches the one posted under your prism id.



At last extra credit

Questions?