forked from pavithraes/flowerpot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flowerpot.py
108 lines (92 loc) · 1.81 KB
/
flowerpot.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
"""
Displays flower ASCII art
"""
import sys
__version__ = "0.0.2"
# ASCII art from https://www.asciiart.eu/plants/flowers
# Because I have the artistic skills of a potato
ROSE = r"""
_____
/ ___ \
/ / _ \ \
/( /( /(_)\ )\ )\
( \ \ ___ / / )
( \ _____ / )
/( )\
| \ / |
| \ _______ / |
\ / \ / \ /
\/ | | \/
| |
| |
| |
"""
SUNFLOWER = r"""
.-.' '.-.
.-( \ / )-.
/ '..oOOo..' \
, \.--.oOOOOOOo.--./
|\ , ( :oOOOOOOo: )
_\.\/| /'--'oOOOOOOo'--'\
'-.. ;/| \ .''oOOo''. /
.--`'. :/|'-( / \ )-'
'--. `. / //'-'.__.'-;
`'-,_';// , /|
'(( |\/./_
\\ . |\; ..-'
\\ |\: .'`--.
\\, .' .--'
))'_,-'`
jgs //-'
//
//
|/
"""
TULIP = r"""
,
/\^/`\
| \/ |
| | |
\ \ /
'\\//'
||
||
||
|| ,
|\ || |\
| | || | |
| | || / /
\ \||/ /
jgs `\\//`
^^^^^^^^
"""
def rose():
print(ROSE)
def sunflower():
print(
SUNFLOWER
)
def tulip():
print(TULIP)
def main(args):
"""
Entry point to flowerpot
"""
if not args:
raise ValueError("Ask for a flower, try: python flowerpot.py sunflower")
if len(args) > 1:
raise ValueError("Ask for one flower at a time. :)")
flower = args[0]
flowers = {
"rose": rose,
"sunflower": sunflower,
"tulip": tulip,
}
try:
display = flowers[flower]
except KeyError:
raise ValueError("Not a valid flower. Try rose, sunflower, or tulip!")
else:
display()
if __name__ == "__main__":
main(sys.argv[1:]) # pragma: no cover