-
Notifications
You must be signed in to change notification settings - Fork 0
/
054-ASCII-art.py
65 lines (57 loc) · 1.11 KB
/
054-ASCII-art.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Here's a cheating lame way to do it.
#import pyfiglet
#def print_intense_ascii_art(text):
# ascii_art = pyfiglet.figlet_format(text, font='big')
# print(ascii_art)
#user_input = input("Enter a string: ")
#print_intense_ascii_art(user_input)
# This other way took an eternity actually, so nvm, but here are the non-tedious parts.
def print_lit_ascii_art(text):
characters = {
'A': r"""
@@@@@@
@@@@@@@@
@@! @@@
!@! @!@
@!@!@!@!
!!!@!!!!
!!: !!!
:!: !:!
:: :::
: : :
""",
'B': r"""
@@@@@@@
@@@@@@@@
@@! @@@
!@ @!@
@!@!@!@
!!!@!!!!
!!: !!!
:!: !:!
:: ::::
:: : ::
""",
# ETC ETC ETC...
'Z': r"""
@@@@@@@@
@@@@@@@@
@@!
!@!
@!!
!!!
!!:
:!:
:: ::::
: :: : :
"""
}
for char in text:
if char.isalpha():
char = char.upper()
if char in characters:
print(characters[char])
else:
print()
user_input = input("Enter a string: ")
print_lit_ascii_art(user_input)