Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple Zalgo text generator in Python where the Zalgoness increases with each word.
from random import choice
marks = map(unichr, range(768, 879))
string = 'clear the current exception in between your catch and the bare raise OH GOD NO EVENTLET IT COMES'
words = string.split()
print(' '.join(''.join(c + ''.join(choice(marks)
for _ in range(i // 2 + 1)
) * c.isalnum()
for c in word)
for i, word in enumerate(words)))
@Victor-VosMottor
Copy link

Python 3.x:

from random import choice
marks = map(chr, range(768, 879))
string = 'clear the current exception in between your catch and the bare raise OH GOD NO EVENTLET IT COMES'
words = string.split()
print(' '.join(''.join(c + ''.join(choice(marks)
                                   for _ in range(i // 2 + 1)
                                   ) * c.isalnum()
                       for c in word)
               for i, word in enumerate(words)))

@iyadahmed
Copy link

iyadahmed commented Jul 27, 2022

from random import choice
marks = list(map(chr, range(768, 879)))
string = 'clear the current exception in between your catch and the bare raise OH GOD NO EVENTLET IT COMES'
words = string.split()
print(' '.join(''.join(c + ''.join(choice(marks)
                                   for _ in range(i // 2 + 1)
                                   ) * c.isalnum()
                       for c in word)
               for i, word in enumerate(words)))

@W1L7dev
Copy link

W1L7dev commented Mar 11, 2023

import random

def zalgo(text: str):
    marks = list(map(chr, range(768, 879)))
    words = text.split()
    print(' '.join(''.join(c + ''.join(random.choice(marks)
                                                for _ in range(i // 2+ 1
                                                ) * c.isalnum()
                                 for c in word)
                       for i, word in enumerate(words)))

zalgo('clear the current exception in between your catch and the bare raise OH GOD NO EVENTLET IT COMES')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment