質問編集履歴
1
generate_move のコードを追加 evaluate_moveを少し追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -110,7 +110,33 @@
|
|
110
110
|
|
111
111
|
def generate_moves(board):
|
112
112
|
|
113
|
+
county = 0
|
114
|
+
|
115
|
+
for y in range(4):
|
116
|
+
|
117
|
+
if county == 1:
|
118
|
+
|
113
|
-
|
119
|
+
break
|
120
|
+
|
121
|
+
for x in range(4):
|
122
|
+
|
123
|
+
if board[y][x] == -1:
|
124
|
+
|
125
|
+
board[y][x] = 0
|
126
|
+
|
127
|
+
countx = 0
|
128
|
+
|
129
|
+
county = county + 1
|
130
|
+
|
131
|
+
countx = countx + 1
|
132
|
+
|
133
|
+
if countx == 1:
|
134
|
+
|
135
|
+
break
|
136
|
+
|
137
|
+
return board
|
138
|
+
|
139
|
+
|
114
140
|
|
115
141
|
|
116
142
|
|
@@ -119,6 +145,12 @@
|
|
119
145
|
def evaluate_move(move):
|
120
146
|
|
121
147
|
#実装
|
148
|
+
|
149
|
+
#3つ自分の石がならんでたら+1
|
150
|
+
|
151
|
+
#3つ相手の石がならんでたら-1
|
152
|
+
|
153
|
+
#それ以外の場合0に実装予定
|
122
154
|
|
123
155
|
|
124
156
|
|