Created
July 15, 2024 13:13
-
-
Save MobCat/7c519d45c9027ca741d9693275ee58f4 to your computer and use it in GitHub Desktop.
Meme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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