https://github.com/devinacker/celldemo
Simple 1D Wolfram cellular automaton using HTML5/JS
https://github.com/devinacker/celldemo
Last synced: 5 months ago
JSON representation
Simple 1D Wolfram cellular automaton using HTML5/JS
- Host: GitHub
- URL: https://github.com/devinacker/celldemo
- Owner: devinacker
- Created: 2014-01-24T02:17:53.000Z (over 12 years ago)
- Default Branch: gh-pages
- Last Pushed: 2018-06-23T09:29:04.000Z (almost 8 years ago)
- Last Synced: 2025-01-20T05:39:26.039Z (over 1 year ago)
- Size: 141 KB
- Stars: 18
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
Live version: http://devinacker.github.io/celldemo/
This is a small old HTML5 / JavaScript demo I wrote a few years ago. It simulates 1-dimensional cellular automata of the sort described by Steven Wolfram. I did this both as an exploration of these automata, which I had recently read about, and as a personal introduction to the HTML5 canvas element.
The demo draws each generation of the simulation as a successive row on the canvas. The rule set is determined by a series of checkboxes corresponding to each possible state of a cell and its two immediate neighbors; the state of the checkbox (on or off) determines whether a cell in a given neighborhood will be alive or dead in the following generation. The rule set can be changed on-the-fly while the simulation is running for some visually and mathematically interesting results.
Some relevant reading material about Wolfram's cellular automata, and the four presets featured in the demo:
http://mathworld.wolfram.com/ElementaryCellularAutomaton.html
http://en.wikipedia.org/wiki/Rule_30
http://en.wikipedia.org/wiki/Rule_90
http://en.wikipedia.org/wiki/Rule_110
http://en.wikipedia.org/wiki/Rule_184
This demo is copyright 2010 Devin Acker. It may be freely modified and distributed in any form as long as you attribute me in some way.