Skip to content
Snippets Groups Projects
Commit e05144b9 authored by syuilo's avatar syuilo
Browse files

✌️

parent c14f946b
No related branches found
No related tags found
No related merge requests found
......@@ -287,8 +287,15 @@ class OthelloContext extends Context {
public async q(query: string): Promise<string> {
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() {
......
......@@ -275,4 +275,6 @@ export function ai(color: string, othello: Othello) {
}
}
}
think();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment