3 ms·
For the python example, instead of using "\" and "/", you could just use the PETSCII characters that the original 10 PRINT as they were ported to unicode. This
by red_hare 9y ago
For the python example, instead of using "\" and "/", you could just use the PETSCII characters that the original 10 PRINT as they were ported to unicode.
This is my version
python3 -c "while 1: print(chr(int(9585.5 + __import__('random').random())), end='')"
- Cthulhu_ 9y agoI tried a JS version, but first I locked my browser window (lol, while (true)), then used console.log which in a browser will always do a newline and deduplicate double logs, then used a string concatenation and the result just isn't as interesting, nor the code as sexy. Note also that ascii codes are different, so no magic with floats and such. var str = '' for (var i = 0; i < 1000; i++) { Math.random() > 0.5 ? str += '/' : str += '\\' } console.log(str)