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
|
SIZE = 20
def column
return "|" * (SIZE / 2)
end
def center_top
spaces = (" " * (SIZE / 2)) + (" " * (SIZE * 2))
return spaces + ("+" * (SIZE / 2)) + spaces
end
def body
return (":" * (SIZE - 1)) + "|" + ("." * SIZE)
end
def seperator
return ("=" * (SIZE * 2)) + ("=" * (SIZE / 2)) + ("=" * (SIZE * 2))
end
def draw_top
puts center_top
end
def draw_roof
SIZE.times do |i|
n = i + 1
str = " " * ((SIZE - n) * 2)
str += "_/"
str += ":" * (i * 2)
puts column + str + column + (str.reverse.sub(/\//,'\\')) + column
end
end
def draw_steeple
SIZE.times do |i|
n = i + 1
str = ":" * (SIZE * 2 - n)
str += "/"
str += "." * i
puts column + str + column + (str.reverse.sub(/\//,'\\')) + column
end
end
def draw_window
SIZE.times { puts column + body + column + body.reverse + column }
end
def draw_floor
puts column + seperator + column
end
draw_top
draw_roof
draw_steeple
draw_window
draw_floor
draw_window
draw_floor
|