2 ms·
JavaScript (in a browser): var r = 0; function go(){setTimeout('document.write(r++ % 80 ? Math.round(Math.random()) ? "\\\\" : "/" : "<br>"); go()', 100)}; go(
by javajosh 14y ago
JavaScript (in a browser):
var r = 0; function go(){setTimeout('document.write(r++ % 80 ? Math.round(Math.random()) ? "\\\\" : "/" : "<br>"); go()', 100)}; go();
This was actually a lot more difficult for me to write than I thought it would be. `document.write` blocks and also a browser doesn't wrap by default, hence the r variable.
This will, of course, nuke any page you happen to run it on. :)
P.S. Why is code formatted so badly on HN these days? Until that's fixed I'll just use normal formatting.
- javajosh 14y agoThe node version is also hard to write. I tried `process.stdout.write` but it always prints a newline, at least from the repl.