After doing this homework you will be able to:
- Write, format, and debug commands to control shapes.
- Create a variety of shapes in an image
- Use the x-y coordinate system to specify the attributes of shapes
- Use variables to store and manipulate attributes of shapes as
part of a process of sketching
In this homework, you will create and experiment with a visual
composition, using variables to alter their look.
For example, I could write a program like the following:
This draws two circles of equal radius on the screen. Now I can vary
what my composition simply by changing the value of the variable
"radius" to make two smaller or two larger circles.
Your task in this assignment will be to create a composition which can
vary by assigning different numbers to key variables in your
program. Your composition must do the following:
- use at least 4 different geometric primitives (e.g. point, line,
- use 'stroke' or 'fill' to change the grey tone from the default
at least twice in the program
- use at least 2 variables
- include at least 4 interesting settings for these variables in the
comments in the code (e.g. "/* x: 20, y: 80; x: 10, y: 15; x:
10, y: 100; x: 50, y: 70 */")
- be properly formatted and readable, using comments where necessary
to explain the code
You may find the following process useful in developing this
- Start by planning on paper. What kind of a composition might be
interesting and fun for you to work on?
- Build up a simple composition without variables, using
different shape, fill, and stroke commands. Add one command at
a time and test your code each time to make sure that it works.
- Once you have a static image you like, substitute variables for
some of the numbers. Each time you put a variable in, add its
initialization at the top of the code and substitute the
variable in for its number in a shape command. Again, work
step by step and test after each change.
- Play with the variable assignments. Vary them and see what effect
this has on your composition. When you find an assignment
that you like, note it in a comment in
- You might decide in the process to change your code around. If
so, go step-by-step and test each time to make sure things
- Before submitting, review the list of requirements to make sure
you have fulfilled all of them.
- Go through your code and add comments anywhere where it might not
be clear to anyone reading your code.
- Upload your code to CMS.
You wil not be judged on your aesthetics, although this will
probably be fun for you to play with, and playing with an eye to
aesthetics is a great way to learn the technical material.
A - Excellent work. The submitted code fulfills all the assignment
requirements and is clear and easy to read. The different
suggested settings for the variables lead to substantially
B - Solid work that demonstrates competence in the material. The
submitted code fulfills all the requirements, with 1 or 2 small
problems that do not hamper functionality, such as problems with
formatting or inadequate (or highly excessive) comments. The
different suggested settings for the variables have a noticeable
impact on the composition.
C - The submitted code runs, but misses substantially on one or
more of the requirements. Alternatively, the code does not run,
but with minor bug fixes would fulfill all the project
D - The submitted code does not run, and/or the submitted code does
not use variables to change functionality.