import os, sys, time, random, shutil
T = [
69,117,114,111,112,97,32,117,110,100,32,67,104,97,109,112,105,111,110,115,32,76,101,97,103,117,101,32,
119,105,114,100,32,109,97,110,32,110,105,99,104,116,32,105,110,32,111,101,102,102,101,110,116,108,
105,99,104,101,110,32,70,111,114,101,110,32,102,105,110,100,101,110,46,32,85,110,100,32,100,97,115,
32,105,115,116,32,97,117,99,104,32,103,117,116,32,115,111,33,32,86,111,110,32,109,105,114,32,103,
105,98,116,96,115,32,107,101,105,110,101,32,119,101,105,116,101,114,101,110,32,73,110,102,111,115,
32,100,97,122,117,33,32,65,117,99,104,32,110,105,99,104,116,32,112,101,114,32,80,78,33,32,68,97,
115,32,107,111,101,110,110,116,32,105,104,114,32,83,99,104,101,105,115,115,101,32,102,105,110,100,
101,110,44,32,97,101,110,100,101,114,116,32,97,98,101,114,32,110,105,99,104,116,115,32,100,97,114,
97,110,33
]
TEXT = "".join(chr(c) for c in T)
GLYPHS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@#$%&*+="
cols, rows = shutil.get_terminal_size()
drops = [random.randint(0, rows) for _ in range(cols)]
CENTER_Y = rows // 2
typed = ""
text_done = False
os.system("clear")
sys.stdout.write("\033[?25l")
def p(t):
l = t.center(cols)
sys.stdout.write(f"\033[{CENTER_Y};1H\033[92m{l}\033[0m")
try:
while True:
for x in range(cols):
if random.random() < 0.95:
continue
if drops[x] == CENTER_Y:
drops[x] += 1
continue
y = drops[x]
c = random.choice(GLYPHS)
sys.stdout.write(f"\033[{y};{x+1}H\033[32m{c}\033[0m")
drops[x] += 1
if drops[x] > rows:
drops[x] = 1
if not text_done:
if len(typed) < len(TEXT):
typed += TEXT[len(typed)]
p(typed)
else:
text_done = True
p(typed)
else:
p(typed)
sys.stdout.flush()
time.sleep(0.05)
except KeyboardInterrupt:
sys.stdout.write("\033[?25h")
pass