Program 5

Objective

The main objective of this assignment is to gain some practice with user defined methods for breaking a problem into smaller pieces and organizing your program.
In addition you will gain further practice with variables (local and global), expressions, and conditional statements. This is also your first assignment where you must write a program to complete a specific task.
 

Program Specification

You are to write a program that generates random quilts. The only real requirement is that your program create the images of the quilts by using layers of functions. There should be a parameterized drawPanel() method, a parameterized drawRow() method (for creating a whole row of panels), and a parameterized drawQuilt() method. Each of these methods must take in at least some x, y value indicating where the panel/row/quilt is to be located. The other parameters are up to you. You may have multiple variations of each of these methods for different types of panels, rows, and quilts, but whenever possible it would be preferable to use parameters to control the different variations. You may also want to have a fourth layer of various panel drawing methods that are called from your drawPanel() method (that is what I did in my solution). For example, you could pass a parameter to drawPanel() that controls the type of panel which then results in one of several panel drawing methods to get called. You might also want to specify for a quilt how many rows and columns of panels or the width and height in pixels. The number of variations is endless. 

When the program starts it should display an quilt. Each time any key is pressed, a new quilt should be drawn.

Your program must meet the following criteria.

  • Have at least three layers of methods to draw a quilt: drawQuilt(), drawRow(),  and drawPanel().
  • Those three methods much each accept at least two parameters, x and y, indicating where to draw the item. The meaning of those values is up to you (upper left corner, lower right, center, bottom middle, or something else).
  • Draw a quilt initially when the program starts.
  • Draw a new (different) quilt each time any key is pressed.
  • Between key presses the quilt should not change, except that as a bonus feature you can have some (not all) panels be animated (sorry no wild flickering), or add moving items in front (like ants crawling across the quilt), or ....
  • It must be easy to change the size of the quilt and the number of panels in the quilt.
  • You must make good use of loops and if statements.

Repeated from the course info page:

The programs you submit this quarter should be original programs created just for this class. It is NOT acceptable to submit programs that you (or someone else) has written previously. As indicated above, if you incorporate any portions of programs written by someone else, or by you for a prior course or assignment, then that should be clearly noted in the program via comments. (See "Giving Credit Where Credit is Due".)

Getting Started

  1. I recommend you begin by creating a very basic building builder that just draws each office/apartment as a rectangle using the layered methods as described above.
  2. Once you are comfortable with the basic structure, then you can begin to add some interesting variations in the building layouts and in the appearance of the individual apartments and offices.

What To Turn In

You will be submitting your program source file (.pde) in CrowdGrader.

The link for the assignment in CrowdGrader is  here.

After the due date you will need to review 5 submissions.

As soon as you have met with your partner to confirm you can work together you should follow the assignment link above and enter the email address for your partner in the group field.

When you and your partner have completed your sketch (program):

  • submit the .pde file as your CrowdGrader submission.  Submit ONLY the .pde file (e.g. MySketch.pde). On your personal computer that file is probably in Documents/Processing/MySketch. In BE109 it should be in x:Processing/MySketch (follow userName's home directory on the Desktop then Processing).
  • BOTH of you should paste a programming log into the text area on the submission page in ecommons. Use one of the sample logs as a template.
  • If you have added any files to your project (fonts or images) then you will need to create a zip file of the sketch folder including both the .pde file(s) and the data folder found there. For instructions on how to create the zip file see the resources.

Grading

See the grading rubric in CrowdGrader.

Although not part of the student review grading process in CrowdGrader, you will lose one point if you fail to submit a program log in Canvas.