Show HN: Print chr$(205.5+rnd(1)) goto 10
JavaScript implementation of the famous `10 print chr$(205.5+rnd(1)) goto 10` one line of BASIC code.
data:text/html,<script>a=()=>{document.write(Math.random()<0.5?'\u2571':'\u2572');document.body.style.cssText="margin:0;padding:0;font-family:monospace;word-break:break-word;font-size:3em;letter-spacing:0;font-stretch:ultra-expanded"};update=()=>{a();window.requestAnimationFrame(update)};update()</script>
Copy and paste the above "link" in your browser.
16 comments
[ 3.4 ms ] story [ 46.7 ms ] threadData URIs: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_...
Edit: Nevermind, I tried again and it did begin to run before the tab closed abruptly. Tried again in an incognito window and it worked, and it also worked in a regular Chrome window with only one tab. Tried to run it in a second tab in that same window and the tab instantly closed again. Anyone know why this might be the case?
Second edit: While it doesn't run in regular Chrome windows with multiple tabs, it does run in Incognito windows with multiple tabs. I don't think I have the expertise to dig further though.
https://mitpress.mit.edu/books/10-print-chr2055rnd1-goto-10
data:text/html,<script>a=()=>{document.write(Math.random()<0.5?'\u2571':'\u2572');document.body.style.cssText="margin:0;padding:0;font-family:monospace;word-break:break-word;font-size:3em;letter-spacing:0;font-stretch:ultra-expanded"};update=()=>{a();window.requestAnimationFrame(update);window.scroll(0,window.scrollMaxY)};update()</script>