diff options
Diffstat (limited to 'src/api/bot')
| -rw-r--r-- | src/api/bot/core.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/bot/core.ts b/src/api/bot/core.ts index 0a073a3127..75564b81e8 100644 --- a/src/api/bot/core.ts +++ b/src/api/bot/core.ts @@ -475,8 +475,8 @@ class OthelloContext extends Context { othelloAi('white', this.othello); if (this.othello.getPattern('black').length === 0) { this.bot.clearContext(); - const blackCount = this.othello.board.map(row => row.filter(s => s == 'black').length).reduce((a, b) => a + b); - const whiteCount = this.othello.board.map(row => row.filter(s => s == 'white').length).reduce((a, b) => a + b); + const blackCount = this.othello.board.filter(s => s == 'black').length; + const whiteCount = this.othello.board.filter(s => s == 'white').length; const winner = blackCount == whiteCount ? '引き分け' : blackCount > whiteCount ? '黒の勝ち' : '白の勝ち'; return this.othello.toString() + `\n\n~終了~\n\n黒${blackCount}、白${whiteCount}で${winner}です。`; } else { |