Files
New-Discord-Edited-Glitch/main.py
T
2026-06-26 17:42:45 +00:00

32 lines
726 B
Python
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import sys
try:
sys.stdout.reconfigure(encoding="utf-8")
sys.stdin.reconfigure(encoding="utf-8")
except (AttributeError, ValueError):
pass
RLE = ""
ALM = "؜"
PUNCTUATION = "!?.,;:…"
def transform(message):
trailing = ""
while message and message[-1] in PUNCTUATION:
trailing = message[-1] + trailing
message = message[:-1]
if "|" in message:
head, _, tail = message.partition("|")
body = head + RLE + trailing + RLE + RLE + tail.replace("|", RLE)
else:
body = message + RLE + trailing + RLE + RLE
return body + ALM + ALM + RLE
while True:
try:
print(transform(input("> ")))
except (KeyboardInterrupt, EOFError):
break