Zalgo Text Generator
Generate creepy Zalgo text using Unicode combining characters.
์์ฃผ ๋ฌป๋ ์ง๋ฌธ
์ฝ๋ ๊ตฌํ
import random
COMBINING_UP = list(range(0x0300, 0x0316)) + list(range(0x033D, 0x0345)) + list(range(0x034A, 0x034D))
COMBINING_DOWN = list(range(0x0316, 0x0333)) + list(range(0x0339, 0x033D))
COMBINING_MID = list(range(0x0334, 0x0339)) + [0x0333]
def zalgo(text: str, intensity: int = 2, direction: str = 'both') -> str:
counts = {1: (1, 1, 1), 2: (3, 3, 2), 3: (8, 8, 5)}
up_n, down_n, mid_n = counts.get(intensity, (3, 3, 2))
result = []
for char in text:
result.append(char)
if direction in ('up', 'both'):
result.extend(chr(random.choice(COMBINING_UP)) for _ in range(random.randint(1, up_n)))
if direction in ('down', 'both'):
result.extend(chr(random.choice(COMBINING_DOWN)) for _ in range(random.randint(1, down_n)))
result.extend(chr(random.choice(COMBINING_MID)) for _ in range(random.randint(0, mid_n)))
return ''.join(result)
print(zalgo('Hello', intensity=2, direction='both'))
Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.