-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsign.py
85 lines (67 loc) · 1.62 KB
/
sign.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
#!/bin/python3
# Created by Jacobus Burger (2022)
# Info:
# I wanted to draw shapes out of ASCII characters.
# Enjoy!
def sign_pythagoras(char: str, height: int):
for row in range(1, height + 1):
print(char*row)
print()
def sign_delta(char: str, height: int):
for row in range(height):
for _ in range(height - row):
print(" ", end="")
for _ in range(row + 1):
print(" ", end=char)
print()
def sign_del(char: str, height: str):
for row in range(height):
for _ in range(row + 1):
print(" ", end="")
for _ in range(height - row):
print(" ", end=char)
print()
def sign_chi(char: str, height: int):
for row in range((height * 2) + 1):
if row >= height and row < height + 1:
for _ in range(2):
print(f"{char*(height*2)}{char*2}")
else:
print(" "*height, end=f"{char*2}\n")
print()
def sign_sq(char: str, height: int):
for row in range(height):
print(char * height)
print()
def sign_disc(char: str, radius: int):
from math import sin
for row in range(radius + 1):
print(" "*int(radius * sin(row)), end=f"{char}\n")
def sign_worm():
print("""
##_
### #
# # #
## #######
""")
def sign_cross():
print("""
#
#
#####
#
#
#
#
""")
if __name__ == '__main__':
print("pythagoras")
sign_pythagoras("-", 3)
print("delta")
sign_delta(".", 5)
print("chi")
sign_chi("#", 3)
print("sq")
sign_sq("*", 5)
print("zero")
sign_disc("-", 3)