From 59fbf693ed05082e9dcb1cd3731116d83d9cfc10 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 10 Mar 2018 12:48:41 +0900 Subject: Implement othello map editing --- src/common/othello/core.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/common') diff --git a/src/common/othello/core.ts b/src/common/othello/core.ts index 8a0af4d508..62ec34f41c 100644 --- a/src/common/othello/core.ts +++ b/src/common/othello/core.ts @@ -69,6 +69,7 @@ export default class Othello { * 黒石の比率 */ public get blackP() { + if (this.blackCount == 0 && this.whiteCount == 0) return 0; return this.blackCount / (this.blackCount + this.whiteCount); } @@ -76,6 +77,7 @@ export default class Othello { * 白石の比率 */ public get whiteP() { + if (this.blackCount == 0 && this.whiteCount == 0) return 0; return this.whiteCount / (this.blackCount + this.whiteCount); } -- cgit v1.2.3-freya