It would actually be doable in 2-3 lines using Unicode characters 2571 and 2572 (both hex), respectively "╱" and "╲".
import sys, random
while True:
sys.stdout.write(random.choice([u'\u2571', u'\u2572']))
sys.stdout.flush()
They're called box drawing characters, it's how ncurses applications draw their GUI. import sys, random
while True :
print( random.choice( [ chr( 92 ) , chr( 47 ) ] ) , end = "" )
sys.stdout.flush( )(parent):
╱╱╱╲╲╲╲╲╲╱╲╲╲╱╱╱╲╱╱╱╲╲╲
╱╱╲╲╲╲╲╲╲╲╱╱╲╲╲╱╲╲╱╱╲╲╲
vs (yours) \\\/\\\//\//\\///\\\\////\
/\////\\\//\\\/\/\/\\\\/
Also in the terminal there isn't the space between the lines for the parent either (that's just HN formatting), but there is a space when using \ or / import random
while True:
print(random.choice("╱╲"), end="")
How's that for readability?python3 -c 'while True: print(__import__("random").choice("╱╲"), end="")'
(loop (princ (char "╱╲" (random 2))))
... or, if you use alexandria (a popular set of utilities) (loop (princ (random-elt "╱╲")))