This morning, I came across the following implementation of Rule 110 in pure HTML5 + CSS3 (no javascript). You press tab and space in sequence to run the automaton.

http://elilies.com/rule110-full.html

I looked at the source code, but I really can't figure out how it's keeping track of state. When tab is pressed, I figure that the :focus selectors come into play, but I am not sure what happens when space is pressed.

有帮助吗?

解决方案

Each of the grid boxes is really a checkbox. Hitting space with it selected toggles its state.

其他提示

You pressing the keys are an "external loop" which is invoking code that is not turing complete: HTML + CSS (excluding CSS Javascript expressions...) always halts so it is not turing complete.

But calling non-turing-complete code in a loop can make it turing complete.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top