-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
125 lines (114 loc) · 6.36 KB
/
main.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
def generate_ascii_art(text, font='default'):
# Define ASCII art characters for each letter in the "default" font
default_font = {
'A': [" A ", " A A ", "AAAAA", "A A", "A A"],
'B': ["BBBB ", "B B ", "BBBB ", "B B ", "BBBB "],
'C': [" CCCC ", "C ", "C ", "C ", " CCCC "],
'D': ["DDDD ", "D D ", "D D ", "D D ", "DDDD "],
'E': ["EEEEE ", "E ", "EEEEE ", "E ", "EEEEE "],
'F': ["FFFFF ", "F ", "FFFFF ", "F ", "F "],
'G': [" GGGG ", "G ", "G GGG", "G G ", " GGGG "],
'H': ["H H ", "H H ", "HHHHH ", "H H ", "H H "],
'I': [" III ", " I ", " I ", " I ", " III "],
'J': [" JJJJ ", " J ", " J ", "J J ", " JJ "],
'K': ["K K ", "K K ", "KK ", "K K ", "K K "],
'L': ["L ", "L ", "L ", "L ", "LLLLL "],
'M': ["M M ", "MM MM ", "M M M ", "M M ", "M M "],
'N': ["N N ", "NN N ", "N N N ", "N NN ", "N N "],
'O': [" OOO ", "O O ", "O O ", "O O ", " OOO "],
'P': ["PPPP ", "P P ", "PPPP ", "P ", "P "],
'Q': [" QQQ ", "Q Q ", "Q Q Q ", "Q QQ ", " QQ Q "],
'R': ["RRRR ", "R R ", "RRRR ", "R R ", "R RR "],
'S': [" SSS ", "S ", " SSS ", " S ", "SSSS "],
'T': ["TTTTT ", " T ", " T ", " T ", " T "],
'U': ["U U ", "U U ", "U U ", "U U ", " UUU "],
'V': ["V V ", "V V ", "V V ", " V V ", " V "],
'W': ["W W ", "W W ", "W W W ", "WW WW ", "W W "],
'X': ["X X ", " X X ", " X ", " X X ", "X X "],
'Y': ["Y Y ", " Y Y ", " Y ", " Y ", " Y "],
'Z': ["ZZZZZ ", " Z ", " Z ", " Z ", "ZZZZZ "],
}
# Define ASCII art characters for each letter in the "special" font
special_font = {
'A': [" | ", " / \\ ", "/___\\", "| |", "| |"],
'B': ["/--- ", "| \\ ", "|---- ", "| / ", "|___ "],
'C': [" __ ", " / ", "| ", "| ", " \\__ "],
'D': ["---\\ ", "| |", "| |", "| |", "|___/"],
'E': ["/----", "| ", "|--- ", "| ", "|___ "],
'F': ["/----", "| ", "|--- ", "| ", "| "],
'G': [" __ ", " / ", "| __ ", "| / ", " \\_\\ "],
'H': ["| |", "|---|", "| |", "| |", "| |"],
'I': [" | | ", " | ", " | ", " | ", " | | "],
'J': [" /", " / ", " | ", " | ", "\\__ "],
'K': ["| ", "| / ", "|/ ", "| \\ ", "| \\ "],
'L': ["| ", "| ", "| ", "| ", "|___ "],
'M': ["| |", "|\\^/|", "| V |", "| |", "| |"],
'N': ["\\ |", " \\ |", " \\ |", " \\|", " \\"],
'O': [" __ ", " / \\ ", "| |", "| |", " \\__/ "],
'P': ["/---\\ ", "| | ", "|--- ", "| ", "| "],
'Q': [" __ ", " / \\ ", "| |", "| \\_|", " \\__\\ "],
'R': ["/---\\ ", "| | ", "|--- ", "| \\ ", "| \\ "],
'S': [" \\__ ", "/ ", "\\__ ", " |", "\\___ "],
'T': ["-----", " | ", " | ", " | ", " | "],
'U': ["| |", "| |", "| |", "| |", " \\_/ "],
'V': ["| |", "| |", "| |", " \\_/ ", " | "],
'W': ["| |", "| |", "| | |", "| V |", "| | |"],
'X': ["\\ /", " \\_/ ", " / \\ ", "/ \\", "\\___/"],
'Y': ["\\ /", " \\_/ ", " | ", " | ", " | "],
'Z': ["-----", " / ", " / ", " / ", "-----"],
}
# Define ASCII art characters for each letter in the "decorative" font
decorative_font = {
'A': [" /\\ ", "/__\\", "| |", "| |", "| |"],
'B': ["||/\\", "||\\_", "|| \\_", "||_/ ", "||/\\ "],
'C': ["|__/ ", "| ", "| ", "| ", "|__/ "],
'D': ["||/\\", "|| \\", "|| \\", "|| |", "||__/"],
'E': ["|||__", "|| ", "||__ ", "|| ", "|||__"],
'F': ["|||__", "|| ", "||__ ", "|| ", "|| "],
'G': [" ||_", "| ", "| __ ", "| | ", "|__| "],
'H': ["|| ", "||___", "|| |", "|| |", "|| |"],
'I': ["_ _", " \\/ ", " /\\ ", " || ", " \\/ "],
'J': [" ___", " | ", " | ", " _] ", "[__ "],
'K': ["|| ", "||__ ", "|| \\", "|| /", "|| \\"],
'L': ["|| ", "|| ", "|| ", "|| ", "||___"],
'M': ["||| |", "||_||", "|| | ", "|| | ", "|| | "],
'N': ["|| ", "||\\ ", "|| \\ ", "|| \\", "|| \\"],
'O': [" || ", "/ \\", "| | ", "| | ", " \\_/ "],
'P': ["||\\ ", "|| \\_", "|| |", "|| ", "|| "],
'Q': [" || ", "/ \\", "| | ", "| | ", " \\_\\ "],
'R': ["||\\ ", "|| \\_", "|| \\", "|| \\", "|| \\"],
'S': [" |_", "/ ", "\\__ ", " |", "|__/ "],
'T': ["|||||", " || ", " || ", " || ", " || "],
'U': ["|| ", "|| ", "|| ", "|| ", " \\_/ "],
'V': ["|| ", "|| ", "|| ", " \\_/ ", " | "],
'W': ["|| | ", "|| | ", "||/\\ ", "||/ |", "|| | "],
'X': ["/\\ /\\", " \\/ ", " /\\ ", " / \\ ", "/ \\"],
'Y': ["|| ", "|| ", "||| ", " || ", " || "],
'Z': ["|||||", " / ", " / ", " / ", "|||||"],
}
# Select the appropriate font
selected_font = default_font if font == 'default' else special_font if font == 'special' else decorative_font
# Convert input text to uppercase
text = text.upper()
# Initialize empty lines for each row of ASCII art
lines = [""] * 5 # Assuming each character is 5 lines tall
# Generate ASCII art for each character in the input text
for char in text:
if char in selected_font:
char_art = selected_font[char]
for i in range(5): # Assuming each character is 5 lines tall
lines[i] += char_art[i] + " " # Add three spaces between characters except for the last one
# Print the generated ASCII art
for line in lines:
print(line.rstrip()) # Use rstrip to remove trailing spaces
# ---------------------------------
# Hello users! The following are where you edit!!!
#----------------------------------
# Example usage with the "default" font:
generate_ascii_art("HELLO")
print("\n") # this can be left alone or removed
# Example usage with the "special" font:
generate_ascii_art("HELLO", font='special')
print("\n") # same as line 118
# Example usage with the "decorative" font:
generate_ascii_art("HELLO", font='decorative')