Improve AI

This commit is contained in:
syuilo 2020-11-19 17:05:22 +09:00
parent 51c6b5fb75
commit a50f219e57

View file

@ -127,19 +127,6 @@ class Session {
//#region 各マスの価値を計算しておく
// 標準的な 8*8 のマップなら予め定義した価値マップを使用
if (this.o.mapWidth == 8 && this.o.mapHeight == 8 && !this.o.map.some(p => p == 'null')) {
this.cellWeights = [
1 , -0.4, 0 , -0.1, -0.1, 0 , -0.4, 1 ,
-0.4, -0.5, -0.2, -0.2, -0.2, -0.2, -0.5, -0.4,
0 , -0.2, 0 , -0.1, -0.1, 0 , -0.2, 0 ,
-0.1, -0.2, -0.1, -0.1, -0.1, -0.1, -0.2, -0.1,
-0.1, -0.2, -0.1, -0.1, -0.1, -0.1, -0.2, -0.1,
0 , -0.2, 0 , -0.1, -0.1, 0 , -0.2, 0 ,
-0.4, -0.5, -0.2, -0.2, -0.2, -0.2, -0.5, -0.4,
1 , -0.4, 0 , -0.1, -0.1, 0 , -0.4, 1
];
} else {
//#region 隅
this.cellWeights = this.o.map.map((pix, i) => {
if (pix == 'null') return 0;
@ -201,12 +188,10 @@ class Session {
(get(x - 1, y ) === 1) // 左
)
if (isSumiNear) this.cellWeights[i] = -0.5;
if (isSumiNear) this.cellWeights[i] = -0.125;
});
//#endregion
}
//#endregion
this.botColor = this.game.user1Id == this.account.id && this.game.black == 1 || this.game.user2Id == this.account.id && this.game.black == 2;