From 5fa5ae6a27f95292363a296b99929a8126b0f0bf Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 19 Nov 2020 21:26:23 +0900 Subject: [PATCH] add memo --- src/modules/reversi/back.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/reversi/back.ts b/src/modules/reversi/back.ts index e7a4538..7f06c7f 100644 --- a/src/modules/reversi/back.ts +++ b/src/modules/reversi/back.ts @@ -126,12 +126,12 @@ class Session { this.maxTurn = this.o.map.filter(p => p === 'empty').length - this.o.board.filter(x => x != null).length; //#region 各マスの価値を計算しておく + // NOTE: 1 を最大値(隅)とする //#region 隅 this.cellWeights = this.o.map.map((pix, i) => { if (pix == 'null') return 0; const [x, y] = this.o.transformPosToXy(i); - let count = 0; const get = (x, y) => { if (x < 0 || y < 0 || x >= this.o.mapWidth || y >= this.o.mapHeight) return 'null'; return this.o.mapDataGet(this.o.transformXyToPos(x, y));