FSEM 131
Lab 2
Variables and Scale
Independent Drawing

Part I due Tuesday September, 27th by 10:00 p.m. on Moodle.
Part II due Thursday September, 29th by 9:55 a.m. on Moodle.

Part I

Review your class notes and the reading Variables chapter posted on Moodle to answer the first questions; read the Arithmetic, Functions chapter also on Moodle before completing the last three questions. These programming questions are the ones you can find at the end of the pdf files you read. Don't forget to include comments.

0. [0 pt] Think about different types of numbers you use daily and write them down. Are they integer or floating-point numbers?

Create a New Processing sketch using the Processing application.
Save your file as exp1.pde.

1. [2 pts] Make a few int and float variables (at least a couple of each). Try assigning them in different ways. Write the values to the console with println().

2. [3 pts] Within the same file create a composition that scales proportionally with difference window sizes. Your composition should use at least three different types of shape. Put different values into size() to test.
Prior to answer this question you have to understand the concept of built-in variables, which is explained in the reading. width and height are pre-defined variables provided by the Processing library, taking the hard-coded values the first line size() call or your program provide.

3. [3 pts] In a new file ellipses.pde use variables to set the position and size for three ellipses. (You don't have to use loops, i.e. repeating similar line of code is okay for now) They should attempt to form a pattern, having some sort of relationship among them. (Three ellipses completely on top of each other are not acceptable; ellipses randomly placed and/or sized neither.)

4. [4 pts] In a new file lines.pde use multiplication to create a series of lines with increasing space between them. The lines should change appearance in the series, color and/or thickness using variables (not just hard coded different values).

Duplicate the three .pde files in a common folder so as to create a zip file that you submit on Moodle.

Part II


In class we use variable definitions to easily change parts of the bunny face and I distributed a code example of a pear, which drawing is defined in terms of variables such that its scale in relation to the window size. In Make (the third required book for this class) study and compare Your task is Submit droid.pde on Moodle before class. Hand-in your design/drawing at the beginning of class.

You can find graph paper outside my office.