Skip to content

Instantly share code, notes, and snippets.

@ahmed4end
Created July 22, 2019 16:24
Show Gist options
  • Save ahmed4end/432745e68ff19964be8612c92838fbef to your computer and use it in GitHub Desktop.
Save ahmed4end/432745e68ff19964be8612c92838fbef to your computer and use it in GitHub Desktop.
import re, random, sys, time
text = "Hello, World!, this message should be printed in a cool way xD"
def CS_Printing(text): #random, re, sys, time
letters = [chr(i) for i in range(65, 91)] + [chr(i) for i in range(97, 123)]
core = lambda text:re.sub(random.sample(text, len(text))[0], random.choice(letters), text, count=1)
res = [text]
for i in range(len(text) + 5):
for i in range(random.randint(1, 3)):
text = core(text)
res.append(text)
for i in res[::-1]:
sys.stdout.write("\r" + i)
sys.stdout.flush()
time.sleep(1/99)
CS_Printing(text)
time.sleep(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment