回答編集履歴
2
ちょっと修正
test
CHANGED
@@ -6,9 +6,11 @@
|
|
6
6
|
|
7
7
|
#!/usr/bin/ruby
|
8
8
|
|
9
|
+
require 'pp'
|
9
10
|
|
10
11
|
|
12
|
+
|
11
|
-
question_dat
|
13
|
+
question_dates = [
|
12
14
|
|
13
15
|
[1,"一郎",43, "ア","イ","ウ","エ" ],
|
14
16
|
|
@@ -46,7 +48,7 @@
|
|
46
48
|
|
47
49
|
for j in 3..6
|
48
50
|
|
49
|
-
if( question_dat
|
51
|
+
if( question_dates[i][j] == answer_datas[j])
|
50
52
|
|
51
53
|
correct_or_incorrect[i] << "○"
|
52
54
|
|
@@ -64,7 +66,7 @@
|
|
64
66
|
|
65
67
|
|
66
68
|
|
67
|
-
p correct_or_incorrect
|
69
|
+
pp correct_or_incorrect
|
68
70
|
|
69
71
|
```
|
70
72
|
|
@@ -72,4 +74,10 @@
|
|
72
74
|
|
73
75
|
結果
|
74
76
|
|
75
|
-
[[1, "一郎", 43, "○", "○", "○", "○"],
|
77
|
+
[[1, "一郎", 43, "○", "○", "○", "○"],
|
78
|
+
|
79
|
+
[2, "二郎", 44, "○", "○", "○", "×"],
|
80
|
+
|
81
|
+
[3, "三郎", 45, "○", "○", "×", "○"],
|
82
|
+
|
83
|
+
[4, "四郎", 46, "○", "○", "○", "○"]]
|
1
変数名変更
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
|
11
|
-
question_dat
|
11
|
+
question_datas = [
|
12
12
|
|
13
13
|
[1,"一郎",43, "ア","イ","ウ","エ" ],
|
14
14
|
|
@@ -46,7 +46,7 @@
|
|
46
46
|
|
47
47
|
for j in 3..6
|
48
48
|
|
49
|
-
if( question_dat
|
49
|
+
if( question_datas[i][j] == answer_datas[j])
|
50
50
|
|
51
51
|
correct_or_incorrect[i] << "○"
|
52
52
|
|