Intro CS Assignments
Assignments by week:
Fall Term:
Winter Term:
Spring Term:
Monday, October 8
Description
Functions, Matrices, and Trees (oh my)
Homework
  • Start work on the Forest lab:

    Your browser does not support the canvas tag.

    (You want happy little trees or else this might happen.)

    The lab should have the following features:

    • A tree() function that uses a loop to draw some part of the tree (you can't just have a rect with a triangle or two).
    • Scaling the trees so they appear to vanish in the distance (perspective).
    • A nice distribution of trees so there are more smaller trees and fewer big trees.
    • You are welcome to add other features once you've done all the mandatory items (different kinds of trees, other shapes, noises, etc.).

    You should have a fully-commented lab file zipped and turned in to me at the beginning of class when we return from parents weekend. You will have other work in the meantime, so don't leave this until the last minute!

    By tomorrow you should at a minimum have a function that draws a tree on the screen. The function should take parameters that specify where on the screen and how large (scaled) the tree should be. If you're having trouble with the function part, at least write a program that draws a single tree somewhere on the screen.

Tuesday, October 9
Description
Forest Lab
Homework
  • Read about Strings and Text.
  • Read up on loading images in Processing:
  • Write a short program that displays an image of your choice, centered vertially and horizontally on the screen. Add text to the screen with a "caption" of the image (can be one word) and have it appear on top of the image somewhere. Due at the beginning of next class.
  • Work on Forest lab. Due when we return from long weekend. If you are stuck, contact me for help. See tomorrow's homework for additional hints.
Thursday, October 11
Description
Text and Images
Homework
  • Complete Forest lab. at the start of next class. If you are stuck, contact me for help. Here are some hints for getting full credit on the lab:
    • Start by getting a tree on the screen using a single function. Then, add the ability to randomize the location of the tree. Then, add the ability to change the scale of each tree. Finally, establish a relationship between the location (vertical) of the tree and its size, so they appear to recede into the distance.
    • Make sure your program starts with a /** Documentation Comment */ with your name, a description of the lab, and any other relevant information.
    • Make sure your program is well-formatted, with appropriate space and indentation (the auto-format option in Processing is useful for this!).
    • Use good variable and function names that describe how the elements of your program fit together.
    • Each type of tree in your program should have its own function to draw it.