Generative Art - Assignment eleven

Due: 2014-01-23 10:30a

Objectives

[15 points] Playing with cellular automata

We looked at some fairly complex automatons during class. I want you to take any one of the 2D examples that we looked at, and make two modifications.

Assignment11

First modification

I want you to extend the neighborhood of the cells on the borders to wrap around. This will require you to go back and visit the code that adds neighbors and change it so that every cell gets full eight neighbors. There are some subtleties here. Our current algorithm works as we add cells to the array, and only adds neighbors that already exist. This breaks down a bit when we want to do a wrap, because going over a border in a direction we usually pick up older cells will result in an empty cell.

There are two ways to handle this. One is to create more special cases that detect when you are on the right edge or the bottom and connect back to the left edge and the top. The second would be to make a second for loop that handles adding the neighbors. So you would keep the original pair of nested for loop and only add cells to the array in it. Then you would create a second, identical pair of for loops that just handled adding neighbors to the cells. The advantage of this second approach is that you could add all eight neighbors because you would know that they were all available. This is probably the easier approach. Note, however, that if you do this you don’t need the reciprocal add that we are using now (i.e., given two neighbors A and B, when we add B to A, we add A to B immediately after it).

Second modification

Give your Cells an age property. This should reflect how long the Cell has maintained its current state. So, every time the update() function gets called and the state hasn’t changed, increment this. If the state does change, set this back to 0. Use this value to change set the color of the cell along with the cell’s current state. Be creative.

[+10 points] Bonus: Take it all a little further

I hope that you play around with things like the number of cells and color, etc, as usual to get something cool. However, you shouldn’t feel limited by the automata I gave you. I will award bonus points if you come up with a new set of rules that creates interesting results or you “think outside the cell”. There is no reason to be restricted to just little squares. You could do different grids, like hexagons or pentagons. You could do looser patterns with more complex notions of “neighbor”. You could retain the grid, but not draw it – just use the components of the individual cells to draw more complex shapes (there are some examples of this in our text book).

Naming your sketch

I would like you to name the sketch using this pattern: username_hw11.

Take a picture

Submit at least one image and name it using the pattern username_hw11-####.png.

Documentation

Don’t forget the documentation block below at the top of your sketch. Make sure that you specify what you did that was cool and interesting.

/**
Assignment Eleven

A description of the sketch.

Your name
The date
**/

Turning in your work

I would like this code turned in in the DROPBOX on MiddFiles. You can refer to the reference on the LIS wiki to help you connect to the file server.