summaryrefslogtreecommitdiff
path: root/src/api/bot
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-03-07 18:45:16 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-03-07 18:45:16 +0900
commit0bca0e8a02e005293663abc4a052ad8f8b2078f3 (patch)
tree046e97207c68833a5c57f536312bea0623bc5b44 /src/api/bot
parentwip (diff)
downloadsharkey-0bca0e8a02e005293663abc4a052ad8f8b2078f3.tar.gz
sharkey-0bca0e8a02e005293663abc4a052ad8f8b2078f3.tar.bz2
sharkey-0bca0e8a02e005293663abc4a052ad8f8b2078f3.zip
wip
Diffstat (limited to 'src/api/bot')
-rw-r--r--src/api/bot/core.ts4
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 {