Skip to content

Instantly share code, notes, and snippets.

@carlos-jenkins
Created June 30, 2018 06:10
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 carlos-jenkins/33367c30b4522119c6d52946d9d980f3 to your computer and use it in GitHub Desktop.
Save carlos-jenkins/33367c30b4522119c6d52946d9d980f3 to your computer and use it in GitHub Desktop.
def lovewins(text='LoveWins'):
def esc(*x):
return '\033[' + ';'.join(x) + 'm'
colors = [7, 1, 3, 63, 2, 4, 5, 7]
for byte in text.encode('ascii'):
print(''.join(
''.join([
esc('30'),
esc(str(colors[index] + 30)),
bit,
esc('0')
])
for index, bit in enumerate('{:08b}'.format(byte))
))
lovewins()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment