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

This is inspired by this classic BASIC program, which is the inspiration for a whole book:

https://10print.org/

(Note that this version of the original is half the size of this Python adaptation!)



Also, I guess you didn't sign up for a code golf session, but this version is 11 bytes shorter:

   import random
   print(''.join(random.choice("/\\") for _ in "x"*9999))
I was surprised to discover that "import random\nrandom.choice", "import random as r\nrandom.choice", and "__import__("random").choice" are all exactly 27 bytes, so no byte count is saved by preferring any of these forms over another!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: