Skip to content

Instantly share code, notes, and snippets.

@commadelimited
Created May 3, 2016 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save commadelimited/0de6f9dcc4db0318bd65142c1f57939d to your computer and use it in GitHub Desktop.
Save commadelimited/0de6f9dcc4db0318bd65142c1f57939d to your computer and use it in GitHub Desktop.
import sys
word = sys.argv[1] # 'dad'
emoji = sys.argv[2] # 'parrot_dad'
letters = dict(
a=[
[1, 1, 1, 1, 0],
[1, 0, 0, 1, 0],
[1, 0, 0, 1, 0],
[1, 1, 1, 1, 0],
[1, 0, 0, 1, 0],
],
b=[
[1, 1, 1, 0, 0],
[1, 0, 1, 0, 0],
[1, 1, 1, 1, 0],
[1, 0, 0, 1, 0],
[1, 1, 1, 1, 0],
],
c=[
[1, 1, 1, 1, 0],
[1, 0, 0, 0, 0],
[1, 0, 0, 0, 0],
[1, 0, 0, 0, 0],
[1, 1, 1, 1, 0],
],
d=[
[1, 1, 1, 0, 0],
[1, 0, 0, 1, 0],
[1, 0, 0, 1, 0],
[1, 0, 0, 1, 0],
[1, 1, 1, 0, 0],
],
e=[
[1, 1, 1, 1, 0],
[1, 0, 0, 0, 0],
[1, 1, 1, 1, 0],
[1, 0, 0, 0, 0],
[1, 1, 1, 1, 0],
],
f=[
[1, 1, 1, 1, 0],
[1, 0, 0, 0, 0],
[1, 1, 1, 0, 0],
[1, 0, 0, 0, 0],
[1, 0, 0, 0, 0],
],
g=[
[1, 1, 1, 1, 0],
[1, 0, 0, 0, 0],
[1, 0, 1, 1, 0],
[1, 0, 0, 1, 0],
[1, 1, 1, 1, 0],
],
h=[
[1, 0, 0, 1, 0],
[1, 0, 0, 1, 0],
[1, 1, 1, 1, 0],
[1, 0, 0, 1, 0],
[1, 0, 0, 1, 0],
],
i=[
[1, 1, 1, 1, 1, 0],
[0, 0, 1, 0, 0, 0],
[0, 0, 1, 0, 0, 0],
[0, 0, 1, 0, 0, 0],
[1, 1, 1, 1, 1, 0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, 1, 0, 0, 0],
],
u=[
[1, 0, 0, 1, 0],
[1, 0, 0, 1, 0],
[1, 0, 0, 1, 0],
[1, 0, 0, 1, 0],
[1, 1, 1, 1, 0],
],
v=[
[1, 0, 0, 0, 1, 0],
[1, 0, 0, 0, 1, 0],
[1, 0, 0, 0, 1, 0],
[0, 1, 0, 1, 0, 0],
[0, 0, 1, 0, 0, 0],
],
w=[
[1, 0, 1, 0, 1, 0],
[1, 0, 1, 0, 1, 0],
[1, 0, 1, 0, 1, 0],
[1, 0, 1, 0, 1, 0],
[1, 1, 1, 1, 1, 0],
],
x=[
[1, 0, 0, 0, 1, 0],
[0, 1, 0, 1, 0, 0],
[0, 0, 1, 0, 0, 0],
[0, 1, 0, 1, 0, 0],
[1, 0, 0, 0, 1, 0],
],
y=[
[1, 0, 0, 0, 1, 0],
[0, 1, 0, 1, 0, 0],
[0, 0, 1, 0, 0, 0],
[0, 0, 1, 0, 0, 0],
[0, 0, 1, 0, 0, 0],
],
z=[
[1, 1, 1, 1, 1, 0],
[0, 0, 0, 1, 0, 0],
[0, 0, 1, 0, 0, 0],
[0, 1, 0, 0, 0, 0],
[1, 1, 1, 1, 1, 0],
],
)
def get_letter(letter):
output = """"""
for line in letters.get(letter):
for index in line:
output += ":{e}:" if index else ":clear:"
output += "\n"
return output
def get_word(word):
output = """"""
for letter in word:
output += get_letter(letter)
return output.format(e=emoji)
if __name__ == '__main__':
print get_word(word)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment