Last active
July 14, 2020 17:45
-
-
Save sentriz/b5642d0be4c172e0c78afb4d40805336 to your computer and use it in GitHub Desktop.
box meme thing generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
if not sys.argv[1:] or len(sys.argv[1]) < 5: | |
print('please provide a 5+ letter word', file=sys.stderr) | |
sys.exit(1) | |
word = sys.argv[1].upper() | |
print('```') | |
print(' '*6 + ' '.join(word)) | |
print(' '*4 + '/' + ' ' + word[1] + ' '*(2*len(word)-5) + '/' + ' ' + word[-2]) | |
print(' '*2 + '/' + ' '*3 + word[2] + ' '*(2*len(word)-7) + '/' + ' '*3 + word[-3]) | |
print(' '.join(word) + ' '*5 + word[-4]) | |
for n in range(len(word) - 5): | |
print(word[n + 1] + ' '*5 + word[n+4] + ' '*(2*len(word) - 9) + word[-n-2] + ' '*5 + word[-n+len(word)-5]) | |
print(word[-4] + ' '*5 + ' '.join(word[::-1])) | |
print(word[-3] + ' '*3 + '/' + ' '*(2*len(word)-7) + word[2] + ' '*3 + '/') | |
print(word[-2] + ' ' + '/' + ' '*(2*len(word)-5) + word[1] + ' /') | |
print(' '.join(word[::-1])) | |
print('```') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment