回答編集履歴
1
Update
test
CHANGED
@@ -32,19 +32,21 @@
|
|
32
32
|
|
33
33
|
|
34
34
|
|
35
|
-
inputs.chars.
|
35
|
+
inputs.chars.each_cons(2).map{|consecutive|
|
36
36
|
|
37
37
|
a, b = consecutive.map{|c| index_on_keyboard(c, keyboard)}
|
38
38
|
|
39
39
|
pos = [[1, 0], [-1, 0], [0, 1], [0, -1]].map{|x, y| [a[0]+x, a[1]+y]}
|
40
40
|
|
41
|
+
nhand = b[0] / 5
|
42
|
+
|
41
43
|
if ([a] + pos).include?(b) then
|
42
44
|
|
43
|
-
mistake += 1 if hand !=
|
45
|
+
mistake += 1 if hand != nhand
|
44
46
|
|
45
47
|
else
|
46
48
|
|
47
|
-
hand =
|
49
|
+
hand = nhand
|
48
50
|
|
49
51
|
end
|
50
52
|
|