Skip to content

Instantly share code, notes, and snippets.

@MobCat
Created July 15, 2024 13:13
Show Gist options
  • Save MobCat/7c519d45c9027ca741d9693275ee58f4 to your computer and use it in GitHub Desktop.
Save MobCat/7c519d45c9027ca741d9693275ee58f4 to your computer and use it in GitHub Desktop.
Meme
#!/env/Python3.10.4
#/MobCat (2024)
# Meme script
# Build "Hello world" from a random array of Unicode
import random
import time
initTime = time.time()
target = ["H", "e", "l", "l", "o", " ", "w", "o", "r", "l", "d"]
work = [""] * len(target)
while target != work:
for index, char in enumerate(target):
if work[index] != target[index]:
# random ascii set
#work[index] = chr(random.randint(0x20, 0x7E))
# Random ASCII and some Unicode set
# Turns out the above was way to easy
work[index] = chr(random.randint(0x20, 0xBFFF))
print(f"{''.join(work)} ", end="\r")
print(f"Hello world found in {round(time.time() - initTime, 2)} seconds")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment