Simple Life in HTML5

For scripts to aid with computation or simulation in cellular automata.
Post Reply
flut1
Posts: 2
Joined: February 6th, 2011, 7:31 pm

Simple Life in HTML5

Post by flut1 » February 9th, 2011, 6:59 pm

I'm currently trying to make a life simulation in HTML5. You won't need java, flash or any other plug-ins, but I do recommend a modern browser. The newest Firefox or Chrome should be fine. You can see it here:

http://florisbernard.nl/colorsoflife

When new cells are born, it calculates the average RGB values of it's neighbors. I don't know if this is very usefull, but it sure looks nice :P

Can anyone give me any tips on how to make the field larger, like on conwaylife.com, without it taking up too much memory? I tried some of the optimizations I found on this forum, but most of them won't work because I have to store the color values as well.

I would love to have your feedback. I have to admit I don't know much about the math and patterns in Life, so please go easy on me.

Axaj
Posts: 232
Joined: September 26th, 2009, 12:23 am

Re: Simple Life in HTML5

Post by Axaj » February 10th, 2011, 8:08 pm

flut1 wrote:I'm currently trying to make a life simulation in HTML5. You won't need java, flash or any other plug-ins, but I do recommend a modern browser. The newest Firefox or Chrome should be fine. You can see it here:

http://florisbernard.nl/colorsoflife

When new cells are born, it calculates the average RGB values of it's neighbors. I don't know if this is very usefull, but it sure looks nice :P

Can anyone give me any tips on how to make the field larger, like on conwaylife.com, without it taking up too much memory? I tried some of the optimizations I found on this forum, but most of them won't work because I have to store the color values as well.

I would love to have your feedback. I have to admit I don't know much about the math and patterns in Life, so please go easy on me.
I've always been interested in this variation on GoL, nice job with the implementation. Unfortunately, it's really quite slow. Something like this would probably be better as a standalone program.
Image

flut1
Posts: 2
Joined: February 6th, 2011, 7:31 pm

Re: Simple Life in HTML5

Post by flut1 » February 11th, 2011, 11:57 am

Axaj wrote: I've always been interested in this variation on GoL, nice job with the implementation. Unfortunately, it's really quite slow. Something like this would probably be better as a standalone program.
It is quite slow compared to stand-alone versions :cry: However, I can get it up to about 40 iterations/second with the newest Google Chrome. Do you think it can be done in HTML when I optimize the script? At the moment it creates two temporary arrays every iteration, one for the number of neighbors and one for the added color values of all neighbors. Can this be reduced to one or maybe even no extra array?

Post Reply