top | item 7685323

Show HN: HTML5 Game of Life in 24-bit RGB

79 points| audiodude | 12 years ago |rgb.0-z-0.com

31 comments

order
[+] DougHaber|12 years ago|reply
I always liked the idea of color life. I like that this did one game for each bit. That's an interesting take on it and the results look nice.

I made a quick color life a few years ago. I wanted the rules to be simple like life itself, so this is what I came up with:

* Each cell has a color attribute. When generating the initial board, colors are randomly assigned.

* When a new cell is created it inherits the most prevalent color of the surrounding cells, or if there is a tie, any one of the the top colors may be used.

(Randomly assigned colors aren't filtered, so it is possible for dark cells to exist that are the same color as the background.)

Here is the result: http://www.node99.net/content/color_life/index.html

[+] guidopallemans|12 years ago|reply
do you have the source code of this?

I had an awesome idea a long time ago that is almost the same as that, but I was a CS noob and tried it in Java...

can you throw that on Github with a license?

[+] TazeTSchnitzel|12 years ago|reply
24 parallel games combined in a way indecipherable to normal human eyes isn't terribly interesting to me.

I find SmoothLife more interesting: https://www.youtube.com/watch?v=KJe9H6qS82I

[+] lgas|12 years ago|reply
If you watch it for a while the patterns in each layer stablize and you end up with a stable overall pattern. It's often very easy to discern blinkers, beacons, gliders and the like.
[+] chrisBob|12 years ago|reply
24 parallel games of like != 24 dimensional game. It appears that the different layers do not interact with each other, or am I missing something?
[+] scrumper|12 years ago|reply
Exactly - this is 24 separate 2 dimensional Games of Life overlaid on each other for visual effect.

To be 24 dimensional, the rules would have to be quite different: at each turn of the game, instead of just considering each cell's 8 neighboring cells on a 2d grid, there'd be 11 additional 2d grids (perhaps represented by different colors), and you'd evaluate the 8 neighboring cells on each of the 11 other 2d grids, iteratively, once for each of the 12 grids. Likely this would not run particularly quickly in a browser (or anything else) for any interestingly large field.

[+] audiodude|12 years ago|reply
Good point, the text has been updated.
[+] zokier|12 years ago|reply
Wonder if different color mappings (LAB/YUV/HSV) would produce more interesting results
[+] transfire|12 years ago|reply
I tend to to think of black as being dead, and white as very much alive. Would rather see what this looks like with the colors flipped back around.
[+] oxalo|12 years ago|reply
Interesting that each 'layer' doesn't carry the same visual weight, and thus it's dominated by only three colors.
[+] lgas|12 years ago|reply
This is very cool. I am working on an implementation of Conway's Game of Life for the Launchpad S which basically has 8-bit color. So far I only have the basic game of life working starting from pre-defined patterns. I want to allow the user to input the starting configuration using the device itself and then trigger samples based on the evolving patterns. But now I have the next goal after that -- implement an 8-bit version of this.

The code is in Clojure (it uses Overtone to talk to the Launchpad S) and is here if anyone is interested:

https://github.com/lgastako/lifepad

[+] konklone|12 years ago|reply
Man, I love this thing.

For extra beauty, turn on the pencil (it can stay the default color, black) and click-drag it across the canvas any which way while there are colors interacting.

It's fascinating to watch the darker colors quickly give way to light ones.

[+] chewmieser|12 years ago|reply
Very cool!

I had started on a basic GOL recently as well (HTML5/Canvas): http://srolfe.github.io/GameOfLife.js/

Still very much a WIP, but it was getting there.

[+] vectorpush|12 years ago|reply
Awesome. This is the best game of life I've seen on the web. It has every feature you could ever want for someone who enjoys creating patterns incrementally.
[+] hetid|12 years ago|reply
That's really nice. Some labeling for buttons would be appreciated. (am on Chrome on a Mac)
[+] ewest|12 years ago|reply
I think a better experience is possible with a start button over a static background to provide the viewer with an idea about what they're about to get into.
[+] rip747|12 years ago|reply
i'm _NOT_ trying to be funny. you should seriously consider putting a warning page on that site that this could induce seizures or migraines.
[+] Dylan16807|12 years ago|reply
I can't imagine how this could cause a seizure. Can you provide more information there?

Migraines I don't know as much about, but I feel like warning people your site has bright colors isn't very important.

[+] Crito|12 years ago|reply
I wonder if it would be feasible to build an accessibility mode into web browsers that suppressed (non-plugin) animations that could trigger photosensitive seizures.
[+] _r5yu|12 years ago|reply
Did a morning thing where I opened up a bunch of HN links in different tabs. Halfway through, my browser started seizing up, operating system becoming unresponsive. Spent 15 minutes diagnosing, checking about:memory and then realized - wait a minute, what about the 24 bit RGB Game of Life tab?

Also, pretty =)

[+] null_ptr|12 years ago|reply
Looks great, and unlike most web demos this one is fairly light on CPU usage!
[+] hakcermani|12 years ago|reply
nice, but would be nice if we could set the number of simulations and speed. the patterns are not clearly discernable (for me personally).
[+] tantalor|12 years ago|reply
Please support touch events.
[+] mschuster91|12 years ago|reply
Gives an interesting effect when on weed, probably also true with other psychoactive drugs.