5 ms·
"Full CSS Nintendo NES" is a bit of a linkbait title. However, it's still kind of amazing, because despite knowing that CSS is not Turing complete, I still cli
by throwaway1980 13y ago
"Full CSS Nintendo NES" is a bit of a linkbait title. However, it's still kind of amazing, because despite knowing that CSS is not Turing complete, I still clicked on it hoping for an emulation. Which effectively means that I identified it as bait and then chose to eat it anyway.
Other than that it's a neat demo.
- orangethirty 13y agoDid you seriously expect a NES emulator written in CSS? Color me surprised.
- madsravn 13y agoBut ... OP promised.
- Zimahl 13y ago.orangethirty { background-color: #ff0000; font-weight: bold; }
- orangethirty 13y agoShouldn't it be: #orangethirty {background: #000;} #orangethirty .surprised { background: #fa0000; font-weight: 700; } (:
- jeffasinger 13y agoI remember seeing an encoding of Rule 110 in CSS + HTML a while back. Is CSS actually not Turing complete?
- throwaway1980 13y agoI'd found this before posting: http://stackoverflow.com/questions/2497146/is-css-turing-complete http://stackoverflow.com/questions/2497146/is-css-turing-com... where the top answer gives a Rule 110 solution, but I was satisfied with this comment: "BRILLIANT!. However, I don't think this qualifies as turing complete. CSS is only able to calculate 1 iteration of the state-machine. Your example relies on the human repeatedly clicking all the orange boxes in order to feed the "output" (pixels) back into the input (page state) and "pump" the state machine. Because there is no programmatic way to use the output of CSS as input, it can't be used to calculate any multi-step loops, the hallmark of turing-complete languages."
- jeffasinger 13y agoThat makes sense. Browser implementors would definitely balk at anything that they couldn't guarantee would stop in a reasonable amount of time.
- throwaway1980 13y agoWhat about JS?
- jeffasinger 13y agoJS is trivially Turing complete (given infinite RAM) See this: http://www.turing.org.uk/turing/scrapbook/tmjava.html http://www.turing.org.uk/turing/scrapbook/tmjava.html
- throwaway1980 13y agoWhat I meant was, why don't browser implementors balk at it?
- jeffasinger 13y agoI think the thing is, that JS can be executed separately from the layout engine, but CSS can't, however, I'm definitely not an expert in the matter.
- gcr 13y agoBrowser vendors control the javascript VM. Though we can't solve the halting problem, we can just throttle or unplug the JS interpreter if it causes usability problems. But CSS is required for the site to look right There's no way to turn it off without messing with the site's layout.