Future Approval and Cell Randomization 10/20/2017

Little work was done over break, but I did take the opportunity to look into receiving Odyssey credit from my college for work done on this project next semester, and seeking approval for other arrangements planned next semester.

This included taking a brief online class over break to teach me about research studies and how to get them approved by our colleges Human Subject Review Board. We will need to seek approval for our future survey by November 17th, and as such, we have started now to ensure we will be able to get it approved in time. This will continue being worked on alongside our typical coding research.

However, expanding my cellular automata program to be more flexible continues still. With a focus on moving some of the logic to a new class, and adjusting the colors to be randomized and more flexible. Thus, we begin taking control of the image being made out of control of the user, and into the computers control.

Cells Randomization

I began by getting my cells working for black and white again. The difference this time is the black and white does not work like an on/off switch, but rather, it is part of a map that can hold as many colors as it likes.

Furthermore, the colors are no longer set in the controller by are set deeper into the code. This I believe will pave the way for the colors to be randomized. Now, instead of having control over what colors you get, the program does.


This might seem like a huge step backwards. However, with a push this allows us to randomize the colors.

As always, some changes cause problems at first, as seen below, the program correctly randomizes a list of colors. However, it only takes into account the first color in the list, corresponding to the key 0, and nothing else.

Random Broke

With a bit of fiddling, we can have the program initialize its own random colors. It does so currently by picking a random number between 2 – 5, determining the number of colors in the list. Each color is a random RGB value.


To make something more insane, we can randomize it to be 2 – 25.CellsLotsofdeath

This is obviously getting pretty crazy. But to push it a step further, can we randomize some of the colors, say, the main “alive” color, as we go? We need some function that will be able to randomize one color each time. This function doesn’t necessarily need to be called.


Furthermore, we can randomize the ruleset at the beginning of each iteration. This will totally take control out of the users hands.

From here, I generalized it so that each function can have the option to change only one rule or one color randomly, or all of them. This makes the functions do more and eliminates the need to call them multiple times.

By randomizing the ruleset each time, we notice a strange bug. It would appear the edge cases are acting up and need to be revisited.


The edge cases are acting up since they don’t have the right amount of neighbors. When dead{0=true} the cells will all come alive since the entire grid is blank. Then, cells close to the edges might die off since they don’t have enough neighbors next time. Or, conversely, they might stay alive after an all alive screen since they technically have less neighbors.

This can be fixed by “wrapping” the edges of the grid around. This will fix our cellular automata edges.

Next week we will set new goals for the project and start something new. As well as continue honing our program and hopefully get approval for our projects arrangements next semester with the administration.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s