Created
September 24, 2020 19:33
-
-
Save giuliano-macedo/c96cecd9a5fea59c66ea78bce2b9c045 to your computer and use it in GitHub Desktop.
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
from io import StringIO | |
from random import gauss,randrange | |
max_chars=63206 #https://sproutsocial.com/insights/social-media-character-counter/ | |
wrong="9" | |
right="6" | |
f=StringIO() | |
print(""" | |
Encontre o seis para ter uma รณtima semana ๐๐๐๐ | |
""",file=f) | |
remaining=max_chars-f.tell() | |
msg_right=f"{wrong*5}\n".encode("utf-8") | |
remaining_lines=remaining/len(msg_right) | |
pos_line=int(gauss(remaining_lines/2,remaining_lines/8)) | |
msg_wrong=bytearray(msg_right) | |
i=randrange(len(msg_wrong)) | |
while True: | |
if msg_wrong[i]!=ord(wrong): | |
i=randrange(len(msg_wrong)) | |
continue | |
msg_wrong[i]=ord(right) | |
break | |
for line in range(int(remaining_lines)): | |
msg=msg_right if line != pos_line else msg_wrong | |
f.write(msg.decode("utf-8")) | |
assert(f.tell()<max_chars) | |
f.seek(0) | |
print(f.read(),end="") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment