-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview.rb
More file actions
105 lines (95 loc) · 1.91 KB
/
Copy pathview.rb
File metadata and controls
105 lines (95 loc) · 1.91 KB
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
class View
def initialize(cube)
@name = cube
@seiten = @name.get_cube
end
private
#ktr 17. 07
def disp_singl(sidenum, highl = nil)
z1 = 1
#zahlenblock breite 5, spacing 4
print " "
while z1 <= 9
if highl == z1 - 1
print "\033[7m#{@seiten[sidenum][z1 - 1]}\033[0m"
print " "
else
print "#{@seiten[sidenum][z1 - 1]} "
end
if z1%3 == 0
puts ""
print " "
else
end
z1 = z1 + 1
end
puts ""
puts ""
end
private
def disp_quad(a, b, c, d, sideh = nil, tileh = nil)
#ktr 17.07
# 5 spaces between blocks
add_value = 0
z2 = 1
c_sides = 0
c_tile = 0
highl = false
sides = [a, b, c, d]
while z2 <= 36
if sideh == sides[c_sides]
if tileh == c_tile
highl = true
end
end
if highl == true
print "\033[7m#{@seiten[sides[c_sides]][c_tile]}\033[0m"
print" "
highl = false
else
print "#{@seiten[sides[c_sides]][c_tile]} "
end
if z2%3 == 0
if z2%12 == 0
puts""
else
print " "
end
end
if z2%3 == 0
if z2%12 == 0
c_sides = 0
c_tile = c_tile + 1
add_value = add_value + 3
else
c_tile = add_value
c_sides = c_sides + 1
end
else
c_tile = c_tile + 1
end
z2 = z2 + 1
end
puts ""
puts ""
end
public
def display(sideh = nil, tileh = nil)
@seiten = @name.get_cube
if sideh == 2
disp_singl(2, tileh)
else
disp_singl(2)
end
if sideh == 4 || sideh == 0 || sideh == 5 || sideh == 1
disp_quad(4, 0, 5, 1, sideh, tileh)
else
disp_quad(4, 0, 5, 1)
end
if sideh == 3
disp_singl(3, tileh)
else
disp_singl(3)
end
end
end