Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does this implementation of turing-complete Rule 110 in HTML5+CSS3 work?

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.

like image 570
silverasm Avatar asked Mar 18 '11 20:03

silverasm


People also ask

Is HTML5 and CSS3 Turing complete?

Apparently, HTML5 + CSS3 is now also Turing complete because it can be used to program a Rule 110 automaton.

Is Rule 110 Turing complete?

Despite its simplicity, Rule 110 is Turing-complete, as proven in Universality in Elementary Cellular Automata (Cook 2004). This implies that, in principle, it can simulate any calculation or computer program. Rule 110 is arguably the simplest known Turing-complete system.

Can HTML be Turing complete?

By itself (without CSS or JS), HTML (5 or otherwise) cannot possibly be Turing-complete because it is not a machine. Asking whether it is or not is essentially equivalent to asking whether an apple or an orange is Turing complete, or to take a more relevant example, a book. HTML is not something that "runs".

Is CCS Turing complete?

CCS(h,k) is the CCS subcalculus which can use at most h constants and k actions. We show that CCS(25,12) is Turing-complete by simulating Neary and Woods' universal Turing machine with 15 states and 2 symbols.


2 Answers

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.

like image 156
usr Avatar answered Sep 28 '22 10:09

usr


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

like image 34
Gareth McCaughan Avatar answered Sep 28 '22 09:09

Gareth McCaughan