Hacker Newsnew | comments | show | ask | jobs | submitlogin

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.




The node version is also hard to write. I tried `process.stdout.write` but it always prints a newline, at least from the repl.

-----




Applications are open for YC Summer 2015

Guidelines | FAQ | Support | Lists | Bookmarklet | DMCA | Y Combinator | Apply | Contact

Search: