Tag Archives: Java

Emblem

My emblem of multiplicity is a Sierpinski triangle. It is a fractal, or self-similar geometric figure, which was first described by Polish mathematician Waclaw Sierpinski in 1915. Basically, the pattern of triangles keeps replicating itself no matter how far you zoom in. The pattern continues into infinity.

sierpinski.clear

I first learned about the Sierpinski triangle in my Java programming class, where I had to write a program that drew some type of fractal art. This project relates to Calvino’s encyclopedic novel, which is by definition incomplete, not because it is unfinished, but because it extends into infinity. Fractals such as the Sierpinski triangle are a good visual example of this.

Advertisements

Leave a comment

Filed under Multiplicity

Analogy

When I think of exactitude, I think about grammar and syntax. These are the foundation of every language, from natural languages, such as English and Japanese, to formal languages, such as computer programming languages. Right now, I’m taking a Java programming class. I’ve never been more exact than when I’m working on a project in Java. Unlike humans, computers take language very literally and do not interpret meaning based on context.

For example, if I were to type the sentence

i luv ice cream its gr8

you would be able to understand it perfectly, even though it’s not grammatically correct. If, however, I were to type something with similar syntactical errors into a computer program, I’d be awash in error messages. I’d have to type something more formal, like this:

I love ice cream. It’s great.

See what I mean? Fortunately, despite their inability to interpret context clues, computer languages are extraordinarily powerful. I used Java to write a program that draws Albers squares, which we learned about in Graphic Design: The New Basics. 

This is what the code looks like:

import java.awt.Color;

public class albers
{
/*This program creates Albers squares. I’m an English major, and I got the
idea for this project from one of my English classes, where we’re learning about Josef Albers.
The program takes 9 command line arguments, which correspond to the RGB values for 3
separate colors. Enter the RGB values (separated by spaces) for your three colors, then run the program
to produce your Albers squares. Have fun!

Ex. java albers 255 0 0 0 0 255 0 0 0 255
will give you a square with red, green, and blue components.

A complete list of colors can be found at:
kb.iu.edu/data/aetf.html
*/
public static void main (String[] args)
{
//command line args–RGB values for 3 Albers square colors
String red1 = args[0];
String green1 = args[1];
String blue1 = args[2];
String red2 = args[3];
String green2 = args[4];
String blue2 = args[5];
String red3 = args[6];
String green3 = args[7];
String blue3 = args[8];

//convert RGB values into color variables
int redVal1 = Integer.parseInt(args[0]);
int greenVal1 = Integer.parseInt(args[1]);
int blueVal1 = Integer.parseInt(args[2]);
int redVal2 = Integer.parseInt(args[3]);
int greenVal2 = Integer.parseInt(args[4]);
int blueVal2 = Integer.parseInt(args[5]);
int redVal3 = Integer.parseInt(args[6]);
int greenVal3 = Integer.parseInt(args[7]);
int blueVal3 = Integer.parseInt(args[8]);

//available colors

Color color1 = new Color (redVal1, greenVal1, blueVal1);
Color color2 = new Color (redVal2, greenVal2, blueVal2);
Color color3 = new Color (redVal3, greenVal3, blueVal3);

StdDraw.setCanvasSize (800,800);

//first Albers square
StdDraw.setPenColor(color1);
StdDraw.filledSquare(.25,.5,.2);
StdDraw.setPenColor(color2);
StdDraw.filledSquare(.25,.5,.1);
StdDraw.setPenColor(color3);
StdDraw.filledSquare(.25,.5,.05);

//second Albers square
StdDraw.setPenColor(color3);
StdDraw.filledSquare(.75,.5,.2);
StdDraw.setPenColor(color2);
StdDraw.filledSquare(.75,.5,.1);
StdDraw.setPenColor(color1);
StdDraw.filledSquare(.75,.5,.05);
}
}

To an untrained eye, it may seem very technical and abstruse, but the point is that the syntax must be flawlessly exact for the program to run.

 

Leave a comment

Filed under Exactitude