Objectives

Upon completing this assignment, you will be able to:

Description

This assignment is inspired by designer Boris Mueller's series of poetry visualizations, each of which is generated by a program that creates visual patterns out of the letters and words in a series of poems. You can play with many of these interactively at Mueller's website.

In this assignment, you will first engage in a series of 'finger exercises' described below. Then you will use the understanding you have developed to create your own unique visualization of the poem of your choice.

Design requirements for the visualization

Your original composition must fulfill the following requirements:

  1. Your program must load the poem you have chosen in plain text from a file.
  2. Your program must create a visualization whose attributes are based on words parsed out of the loaded file using split() or splitTokens(). It must process and base its visualization on all of the words in the file. At least 2 aspects of each word (e.g. the characters that make it up, its length, how common it is) must have different, discernible effects on the visualization.
  3. Your composition must be original, i.e. it should not closely resemble examples covered in class nor your fellow classmates'. It is fine if it is inspired by Mueller's examples or by others for which source code is not readily available.
  4. Your program must define and use at least one original function to modularize your code.
  5. As always, your code must be clean, clear, and well-documented.

Finger exercises

You should note that for many of these exercises it makes sense to copy and paste your answer to the previous problem as the start for your answer to the next problem. If particular finger exercises are covered in class, you can submit your in-class-created pair-programming version as a solution.

  1. Create a String variable which holds a single word. Create a rectangle whose width is proportional to the length of the word. Try several different words to make sure your code works.
  2. Adapt the secret code exercise we did in class so that each letter in your string is used to create a randomly located square on the screen whose grayscale color is equal to that letter's secret code.
  3. Create a String variable that holds a sentence of your choice with at least 3 words separated by spaces. Using split() and a for loop, go through each word in the sentence and write it to the screen at a random location.
  4. Repeat this exercise, using a sentence that has punctuation such as , or ;, and using splitTokens() to break the sentence up. Each word you write to the screen should include only letters, not punctuation.
  5. Read a text file in of your choice. Create a for loop which goes through each line in the file and uses println to output that line of the file to the console.
  6. Repeat this exercise, adding an additional for loop which uses splitTokens to splits each line into its individual words, without punctuation. Println should therefore output each word individually on a new line.
  7. Read in the text file of your choice. For each word in the file, create a circle which is randomly located and whose width is proportional to the length of the word.

For this assignment, please submit a zipped folder which contains both your finger exercises and your poem composition sketch. The poem sketch should include the poem text file you are using located properly to load when the sketch is started.

Grading scheme

A+ - All required elements included, plus an interesting and creative approach to fulfilling the assignment requirements.

A - All required elements included and functioning correctly. Code is clean, clear and well-documented. Clear thought went into the selection of algorithmsused and they demonstrate mastery of image processing. Finger exercises completed satisfactorily.

B - Competent response to the assignment showing overall mastery of course material, with some small errors that do not greatly affect the quality of the assignment. For example, the code may be somewhat baroque (too complex for what it does), the choice of algorithms appears accidental, the code may be formatted incorrectly, or the finger exercises are poorly completed.

C - Some bigger errors, or a larger collection of smaller errors, but with potential to develop into a competent response. For example, the code may not run, but with a few small syntactical fixes would properly fulfill the assignment; the code may work but not be comprehensibly written; the code completely misses on one of the requirements, but still shows some understanding of the unit's material; or the finger exercises are not completed.

D - Serious errors show clear effort, but serious gaps in understanding, such as code that does not run and is not close to being correct, fulfills only part of a requirement, or is copied fairly directly from examples used in class.

F - Little demonstrated effort, or clear effort with no understanding, such as code fragments submitted which are only the start of a response to the assignment.