Skip to content

Instantly share code, notes, and snippets.

@alexmojaki
Created May 26, 2016 18:39
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save alexmojaki/8a4ba43e66ee78a99b8435e05818a3e3 to your computer and use it in GitHub Desktop.
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)))

@esnosy
Copy link

esnosy 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