Wireworld is a cellular automaton that was designed to be resemble electrons flowing through wires. Its simple mechanics allow the construction of digital circuits. It has even permitted the construction of an entire computer.
Your mission is to create the shortest Wireworld implementation in your language of choice.
Each cell in the grid has one out of four states. The four states are "blank," "copper," "electron head," or "electron tail."
- A blank cell will always remain a blank cell
- An electron head will always become an electron tail
- An electron tail will always become copper
- A copper cell will become an electron head iff exactly one or two out of its eight neighbors are electron heads, otherwise it will remain copper
This competition will have a similar style to the Shortest Game of Life competition, but with a few changes.
- The grid must be at least 40 by 40 cells
- The edges of the grid must NOT wrap around (not a torus). Treat cells outside of the field as being constantly "blank."
- It must be possible for the users to enter their own starting configuration.
- Staring at blank screens is not fun. The program must visually display the simulation as it is running.
I will pick the winner as a combination of shortest code, usability, speed, and prettiness. I don't really care too much about prettiness, but usability is pretty important. Just make sure that you keep the code short. Good luck!