-
Notifications
You must be signed in to change notification settings - Fork 0
/
rhombus1.py
48 lines (42 loc) · 916 Bytes
/
rhombus1.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
#Chaotic implementation of a z-rhombus.
"""
3-levels output example:
z
zzz
zzzzz
zzzzzzz
zzzzz
zzz
z
"""
#We determine each side's altitude
floors = int(input())
x = 1
#Calculation of diagonal angles
white_spaces = (x+2*floors)+(floors+3)
#Printing out the upper triangle
for i in range(floors):
for j in range(white_spaces):
print(" ", end = "")
white_spaces -= 1
for j in range(x):
print("z", end = "")
x += 2
print("")
#Printing out intermediate axis
for i in range(x+3):
print(" ", end = "")
for i in range(x):
print("z", end = "")
print("")
#Printing out the lower triangle
white_spaces = x + 4
x-=2
for i in range(floors):
for j in range(white_spaces):
print(" ", end = "")
white_spaces += 1
for j in range(x):
print("z", end = "")
x -= 2
print("")