From e05144b93ee671e03739640868d32a4d31b91b35 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 8 Oct 2017 04:13:38 +0900 Subject: :v: --- src/api/bot/core.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/api/bot/core.ts') diff --git a/src/api/bot/core.ts b/src/api/bot/core.ts index ca5f5b89eb..207de71619 100644 --- a/src/api/bot/core.ts +++ b/src/api/bot/core.ts @@ -287,8 +287,15 @@ class OthelloContext extends Context { public async q(query: string): Promise { this.othello.setByNumber('black', parseInt(query, 10)); + const s = this.othello.toString() + '\n\n...(AI)...\n\n'; othelloAi('white', this.othello); - return this.othello.toPatternString('black'); + if (this.othello.getPattern('black').length === 0) { + this.bot.clearContext(); + return '~終了~'; + } else { + this.emit('updated'); + return s + this.othello.toPatternString('black'); + } } public export() { -- cgit v1.2.3-freya