• R/O
  • HTTP
  • SSH
  • HTTPS

learning: Commit


Commit MetaInfo

Revision8059291464c3f1aa60062c5017b092e6998c731a (tree)
Time2018-01-10 08:34:37
Authoryamat0jp <yamat0jp@yaho...>
Commiteryamat0jp

Log Message

どうしても弱かったので角っこの周辺に置きにくいように教えました。

僕が間違っていたと思います。このアルゴリズムでは強いオセロAIはできません。たぶん。

Change Summary

Incremental Difference

--- a/network.py
+++ b/network.py
@@ -66,8 +66,7 @@ class Comp():
6666 s = False
6767 break
6868 elif temp[i][j] == 1:
69- k += 1
70-
69+ k += 1
7170 if s == False:
7271 break
7372 if (s == True)and(k > 32):
--- a/reversi.py
+++ b/reversi.py
@@ -216,18 +216,27 @@ def hyouka():
216216 i = 0
217217 x = stone_grid.item
218218 corner = [x.grid[0][0],x.grid[0][7],x.grid[7][0],x.grid[7][7]]
219+ n_corner = [x.grid[0][1],x.grid[1][0],x.grid[1][1],
220+ x.grid[7][7],x.grid[6][7],x.grid[7][6],
221+ x.grid[0][6],x.grid[1][7],x.grid[6][6],
222+ x.grid[6][0],x.grid[7][1],x.grid[6][1]]
219223 for y in corner:
220224 if y == black:
221- i += 2
225+ i += 4
222226 elif y == white:
223- i -= 2
227+ i -= 4
228+ for y in n_corner:
229+ if y == black:
230+ i -= 1
231+ elif y == white:
232+ i += 1
224233 corner = [(0,0),(0,7),(7,0),(7,7)]
225234 for y in corner:
226235 if stone_grid.CanSetStone(black,y[0],y[1],False) == True:
227- i += 1
236+ i += 2
228237 stone_grid.item.grid[y[0]][y[1]] = none
229238 elif stone_grid.CanSetStone(white,y[0],y[1],False) == True:
230- i -= 1
239+ i -= 2
231240 stone_grid.item.grid[y[0]][y[1]] = none
232241 return i
233242
Show on old repository browser