Hi There!

I'm Dan Schlegel, an Associate Professor in the Computer Science Department at SUNY Oswego

Programming Challenge 4: Nonrepresentational Artistic Expressions

Overview

Your task is to write three separate Java programs for this assignment, all in the context of the Nonrepresentational Painting World (NPW). These programs will make use of both the painter functionality and the shapes functionality of the world. You will be asked to place each of these programs in the npw package of your CS1 project.

Why do it?

By composing Java solutions to these non-representational artistic expression problems you will:

  1. Gain considerable practice in creating and using objects.
  2. Practice using selection and repetition constructs.
  3. Further explore the notion of creativity from constraint in the course of microworld problem solving.

The Entrance

You should review the Nonrepresentational Painting World functionality, and the mechanisms for selection and repetition previously presented in lecture and in lab. You might also like to adopt a frame of mind in which laying down shapes in the plane resonates with nonrepresentational art. Perhaps you would like to Google Klee, Stella, Hirst, and a number of other modern artists, in order to explore some of their images and ideas.

Problem 1: Deterministic Invention

Write a program called Invention1 in your npw package which paints an image subject to the following constraints. You can tailor from other things we’ve done, but be sure you’re making your own thing!

  1. It uses at least one while statement in a nontrivial way.
  2. It uses at least one if statement in a nontrivial way.
  3. It features both circles and squares, all created from just one circle and just one square. No rectangles.
  4. It creates the exact same image every time it is run.
  5. There is some chance that the casual observer might find the image interesting!

Run it twice to make sure the output is the same each time you run the program.

Problem 2: Nondeterministic Invention

Write a program called Invention2 in your npw package which paints an image subject to the following constraints. You can tailor from other things we’ve done, but be sure you’re making your own thing!

  1. It uses at least one while statement in a nontrivial way.
  2. It uses at least one if statement in a nontrivial way.
  3. It features solely rectangles, all generated from a single rectangle.
  4. The program takes no input from the user of the program.
  5. It creates a different image each time the program is executed, different with respect to number, or size, or color, or whatever of the featured object.
  6. There is some chance that the casual observer might find the image interesting!

Run it twice to make sure the output is not the same each time you run the program.

Problem 3: Stella


Write a program called Stella in your npw package which paints images like the ones just presented. The constraints are these:

  1. The number of concentric squares will be read from a dialog box. The last question on the first practice exam has a method for reading numbers from a dialog box – see if you can make use of it here!
  2. Two randomly chosen colors will be used for the image that is painted when the program is run.
  3. The canvas will be of size 800 by 800 and the largest square will be 700 by 700.

Run the program several times, doing your best to enjoy looking at the output.

The Exit

  1. Due date: Thursday March 25, 2021
  2. Once you are ready, you must demo your programs for one of the TAs.
  3. You must post your work, a source program and an appropriate demo for each problem, to your Web Work Site to receive any credit.