Pergunta

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.

Foi útil?

Solução

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

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top