## Conway’s Game of Life

Conway’s Game of Life is a simulation of cells interacting with other cells, or an example of cellular automata. White squares represent dead cells, and black squares represent live cells. There a few simple rules governing the universe:

• Any cell with less than 2 neighbors dies from loneliness
• Any cell with over 3 neighbors dies from overpopulation
• Any cell with 2 or 3 neighbors stays alive
• Any dead cell with exactly 3 neighbors can become alive (through reproduction)

The simulation is performed using these rules, which are repeated over and over on the entire grid. These simple rules can lead to extraordinarily complex systems. Most systems, however, (especially random ones) will eventually collapse into unmoving shapes or simple oscillators. I created a version of Life in JavaScript using the HTML5 canvas. A 2-dimensional array stores the grid of squares. You can run it here or see the code here. The simulation is completed in a “closed” universe, where I have border cells (not shown on the screen) on the edges to prevent calculation errors with cells missing neighbors. These cells are always white and have no calculations performed on them. The program I wrote is not interactive, as I just wanted to see if I could make a version of Life using JavaScript. I might make an interactive one in the future, but for now I would recommend this simulation that I have been using. My programs starts with half of the cells alive (randomly selected) and eventually stabilizes. If you refresh, the simulation will restart.

## Bézier Curve Rainbow

I decided to learn more about Bézier curves, so I read this excellent Wikipedia article about them. The part that I used the most shows animated diagrams of Bézier curve formation. What I got out of it was this: if we have the x and y coordinates of points a, c, and b we can create a quadratic Bézier curve from them. As we … Read moreBézier Curve Rainbow

## Rainbow Matrix

This is a JavaScript program I wrote, in the style of the movie “The Matrix.” Random characters are selected from a list and then drawn onto the HTML5 canvas. Arrays store the x and y locations and color of each column. You can also run the program or see the code.

## Counting Program

I wrote a counting program that shows the number of seconds since 0 A.D., the number of seconds until the new year, and other interesting statistics. I want to add more statistics in the future. You can run the current version here, or view the JavaScript code here.

I made some changes to the quadratic equation art program, so that there are now more curves and they are closer together – I would also like to smooth the innermost curves more.

This is several quadratic equations graphed in different shades of blue, creating a kind of pattern. It works by graphing one equation after another on the HTML5 camera with JavaScript, in the form y=ax2 (+bx+c, b and c are in this case equal to 0 and therefore omitted), and gradually decreases the a value, or the coefficient of x. You can run the program for yourself here, or view the code here.

## Another Variant of the Sierpinski Triangle

Here’s another variant of the Sierpinski triangle, this one with several detached parts. You can also run the program or view the code I used to create it.

## Variants of the Sierpinski Triangle

These are some variants on my Sierpinski triangle program with the chaos game method. I used a slightly different equation (by accident – this was a bug) to govern the transformation of a point. You can run the program for the first one here, or the second one here. You can also view the code … Read moreVariants of the Sierpinski Triangle

## “Chaos Game” Sierpinski Fractal Generation

This is a Sierpinski triangle fractal generated using the chaos game method, in which a point inside a triangle is copied halfway to any random vertex of the triangle. That is to say, we pick a point inside an initial triangle, then randomly select a corner in that triangle. We then take the x and y coordinates of that corner/vertex and find the difference between that and the coordinates of the starting point. Finally, we divide those differences by 2 and use those as the coordinates for the next point, and repeat. If you want, you can run the program I wrote to generate the fractal, or look at the code (in JavaScript) I used.

## Graphing Program

I wrote a graphing program in JavaScript that colors each pixel based on a function of the x and y values of the pixel. This graph is created when red = (x/3)^2+(y/3)^2, green = (x/3)^2+(y/3)^2, and blue = (x/3)+(y/3). I might add more to this in the future, I think it’s a pretty interesting idea. You can try … Read moreGraphing Program