-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path21.rb
41 lines (32 loc) · 852 Bytes
/
21.rb
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
#############################################################################
# 1
#############################################################################
numeric = {
'A' => {
'0' => 2, '3' => 2,
'2' => 3, '6' => 3,
'1' => 4, '5' => 4, '9' => 4,
'4' => 5, '8' => 5,
'7' => 6
},
'0' => {
'A' => 2, '2' => 2,
'1' => 3, '3' => 3, '5' => 3,
'4' => 4, '6' => 4, '8' => 4,
'7' => 5, '9' => 5
},
'1' => {
'2' => 2, '4' => 2,
'0' => 3, '3' => 3, '5' => 3, '7' => 3,
'A' => 4, '6' => 4, '8' => 4,
'9' => 5
},
'2' => {
}
}
directional = {}
codes = File.readlines('input_test03.txt').map(&:chomp).map(&:chars)
result = 0
#############################################################################
# 2
#############################################################################