Computer Science 217
Assignment #3
You'll be writing a Python program to interface with the Quickdraw
graphics utility, and structure your program using functions to
reflect its design.
- This is an individual assignment. What you submit must be your own
work, although you may discuss the problem in general terms
with other people. You should definitely not be showing other people
your code, and generally speaking, it is not a good idea to talk about
the assignment when you're sitting in front of the computer.
- Sources of algorithms and code, if any, must be properly cited.
Remember that plagiarism regulations apply to code too.
You can put citations into comments in your Python code.
- If you have any questions about what you can and can't safely do,
feel free to email me.
Write a Python program that, when used with the Quickdraw graphics
tool, draws a scene (indoor or outdoor) of the University of Calgary
campus. Your program must produce a sequence of Quickdraw commands
that are piped into the Quickdraw utility, as demonstrated in class
and as described on the Introduction to
Quickdraw
page.
Your scene must be subject to the following constraints:
- Your scene must be recognizable as a place on campus, i.e., you
could walk there and see exactly what you've drawn (except
nonstationary
things like people, animals, and vehicles). No modern
art, please.
- The scene should be suitable for family viewing.
- You must have at least ten high-level elements in your scene, e.g.,
building, sun, person.
- The high-level structure of your scene should be immediately
apparent by looking at the function calls in the main part
of your program.
- You must use at least one loop. Hint: think of some repeated picture
element, like windows in a building.
- You must use arguments (a.k.a. parameters) for your functions
where appropriate. Hint #1: if you have a bunch of functions to draw
shapes, a good use for an argument is to control the size,
position, and/or color. Hint #2:
at a higher level, some picture elements like trees and animals can
be drawn at different scales that can be controlled with an argument.
- You must actually draw the picture; you can't have the turtle
just render pixels from a real picture.
What constitutes ``high-level elements'' is intentionally vague
because a) to precisely specify it would likely be very lengthy and b)
it would hamper your creativity. It's like trying to say what
constitutes ``nine items or less'' in the express checkout at Safeway;
some common sense must be used, and a carton of eggs is one item, not
twelve.
Basically, the intent is for high-level objects to be discrete,
distinct visual items. If you have a bunch of trees that all look
alike except for maybe the size or color, that's one item. If you
have two obviously different types of tree (e.g., pines and oaks) that
are rendered by different code, then that's two items. Decorations on
an object, like windows or doors on a building, would be part of the
building.
Your TAs will be identifying the best 2-3 scenes for me for posting
on the course website. The best of these, as chosen by the class,
will receive a prize. If you are not comfortable with having your
picture displayed on the course web page, please communicate this to
your TA by email and in the comments of your Python program.
- You might want to take a few pictures on your camera phone to
help while you're designing your picture.
- Design your scene on paper before trying to implement it.
- Make a directory to keep your files for this assignment in.
- Take notes as you go along, so you can remember what you've
tried already and what did and didn't work.
- Break the task down into small pieces.
- Use an incremental approach -- try the graphical commands out directly in Quickdraw
first, as you go, before
putting them in your program.
- See the Introduction to
Quickdraw
for information about working with Quickdraw in conjunction
with Python. The complete reference for Quickdraw, as well as
tutorials demonstrating more of its features, can be found on
the Quickdraw
Page. .
- Work through everything one last time prior to your demo to
help catch any last-minute problems.
- Make absolutely sure that your solution will run on the Computer Science machines!
- The Prairie Chicken should provide a good challenge. The Zipper
might be hard to get looking decent too.
You must do two things:
- Hand in a printout of your solution to the assignment boxes by
4pm Friday, 12 March 2010. Make sure it has your name
and/or student ID number on it, and double-check to ensure
you're using the correct assignment box! The assignment boxes are
on the second floor of the Math Science building. Note that
you may turn your printout into the box early.
If your TA is accepting solutions in any other form (e.g., email)
then they will let you know - however, you must still observe
the deadline.
- Demonstrate your solution to your TA in tutorials during the
week of March 15. To keep things fair,
the solution you demonstrate must
be the same as what you handed in on the printout, or you will
not be given credit for the demo. Your TA may ask you
questions about what the different parts of your
solution do.
If you do not hand in a printout or if you do not demonstrate your
assignment during tutorial time, or both, you cannot be given a grade
above a zero on this assignment.
Your printout must show your Python program. Note
that you must have a program in a .py file - you cannot turn in a
solution that only uses the Python command line.
Your solution must be demonstrated using your account on the CPSC machines.
Tutorials during the week of March 15 are allocated for demos. Your
TA is not obliged to see demos outside this time; they have their own
schoolwork to do!
The TA has the right to assign a mark of zero for the entire
assignment if you fail the demo.
2/3 of the marks assigned are for your solution (as shown on the
printout). These marks will be assigned for documentation, like
appropriate variable names and comments, for the structure of your
program, and for meeting the constraints listed in the specification
above. The remaining 1/3 of the marks are for functionality and the
aesthetic quality of the scene you generate.