5

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.

silverasm
  • 511
  • 5
  • 10
  • 1
    I'm not sure if that is really Turing-Complete (even if Rule 110 is) because of the fixed set of states, although it is cool. The state is kept in the grid of checkboxes and the selector match off that (tab switches/makes active, space toggles value). –  Mar 18 '11 at 21:00
  • 1
    The link seems broken. The source code is in [github](https://github.com/elitheeli/stupid-machines/blob/master/rule110/rule110-full.html) \[[live demo](https://rawgit.com/elitheeli/stupid-machines/master/rule110/rule110-full.html)\]. – Oriol Feb 11 '15 at 22:25
  • 1
    The live demo is broken. – mbomb007 Feb 06 '18 at 03:41

2 Answers2

8

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.

usr
  • 162,013
  • 33
  • 219
  • 345
3

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

Gareth McCaughan
  • 19,045
  • 1
  • 37
  • 55