Skip to content

Instantly share code, notes, and snippets.

@JoshuaPaulBarnard
Last active January 30, 2024 04:10
Show Gist options
  • Save JoshuaPaulBarnard/b2e28de4958cb25e9f545ec7297aed00 to your computer and use it in GitHub Desktop.
Save JoshuaPaulBarnard/b2e28de4958cb25e9f545ec7297aed00 to your computer and use it in GitHub Desktop.
1337 Speak Converter
# 1337 Speak Converter
# Author: Joshua Paul Barnard
# Date: January 29th, 2024
# This is my 1337 speak converter. There are many like it, but this one is mine.
# There are many different ways to use 1337 speak, and some letters can have tens of variations.
# So I created this converter to be able to quickly convert text into my style of 1337.
# Function to replace characters
def replace_chars(input_string, replacements):
modified_string = ""
for char in input_string:
modified_string += replacements.get(char, char)
return modified_string
# Define the characters to be replaced.
leet_replacements = {
'1' : 'i',
'2' : 'Z',
'3' : 'E',
'4' : 'A',
'5' : 'S',
'6' : 'b',
'7' : 'T',
'8' : 'B',
'9' : 'q',
'0' : 'o',
'a': '/-\\',
'A': '/-\\',
'b': '8',
'B': '8',
'c': '(',
'C': '(',
'd': '[)',
'D': '[)',
'e': '3',
'E': '3',
'f': '|=',
'F': '|=',
'g': '6',
'G': '6',
'h': '|-|',
'H': '|-|',
'i': '1',
'I': '1',
'j': '_|',
'J': '_|',
'k': '|<',
'K': '|<',
'l': '|_',
'L': '|_',
'm': '/\\/\\',
'M': '/\\/\\',
'n': '/\\/',
'N': '/\\/',
'o': '0',
'O': '0',
'p': '|>',
'P': '|>',
'q': '(,)',
'Q': '(,)',
'r': '|2',
'R': '|2',
's': '5',
'S': '5',
't': '7',
'T': '7',
'u': '|_|',
'U': '|_|',
'v': '\\/',
'V': '\\/',
'w': '\\/\\/',
'W': '\\/\\/',
'x': '><',
'X': '><',
'y': '`/',
'Y': '`/',
'z': '-/_',
'Z': '-/_'
}
# Request input for the english words to be converted.
original_input = input("Enter your text to be converted into 1337: ")
# Perform replacement of letters and numbers to 1337-style
leet_speak = replace_chars(original_input, leet_replacements)
print(leet_speak)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment