7 ms·
# Without unicode or pygame (using Python3) import sys, random while True : print( random.choice( [ chr( 92 ) , chr( 47 ) ] ) , end = "" ) sys.stdo
by zaf 9y ago
# Without unicode or pygame (using Python3)
import sys, random
while True :
print( random.choice( [ chr( 92 ) , chr( 47 ) ] ) , end = "" )
sys.stdout.flush( )
- icc97 9y agoThis one doesn't look correct in the terminal though as the characters don't join up (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 /
- zaf 9y agoThat's because of HN formatting.
- icc97 9y agoIt's because u'\u2571' is a different character from chr(92)
- rubenbe 9y agoThe C64 font is (almost?) square, this also contributes to the nice effect.
- rothron 9y agoIt's square as it's 8x8 pixels, but the pixels themselves are not. There's a difference in aspect ratio between PAL and NTSC variants, and because the C64 was usually connected to a CRT, pretty much all bets are off.
- Ao7bei3s 9y agoimport random while True: print(random.choice("╱╲"), end="") How's that for readability?