mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 14:00:22 +02:00
Fix
This commit is contained in:
@@ -122,25 +122,22 @@ module.exports = class ConnectFourCommand extends Command {
|
|||||||
max: 1,
|
max: 1,
|
||||||
time: 60000
|
time: 60000
|
||||||
});
|
});
|
||||||
if (!turn.size) {
|
const choice = turn ? turn.first().content : null;
|
||||||
|
if (!choice) {
|
||||||
await msg.say('Sorry, time is up! I\'ll pick their move for them.');
|
await msg.say('Sorry, time is up! I\'ll pick their move for them.');
|
||||||
i = AIEngine.playAI('hard');
|
i = AIEngine.playAI('hard');
|
||||||
lastMove = i + 1;
|
lastMove = i + 1;
|
||||||
continue;
|
} else if (choice.toLowerCase() === 'end') {
|
||||||
}
|
|
||||||
const choice = turn.first().content;
|
|
||||||
if (choice.toLowerCase() === 'end') {
|
|
||||||
winner = userTurn ? opponent : msg.author;
|
winner = userTurn ? opponent : msg.author;
|
||||||
break;
|
break;
|
||||||
}
|
} else if (choice.toLowerCase() === 'play for me') {
|
||||||
if (choice.toLowerCase() === 'play for me') {
|
|
||||||
i = AIEngine.playAI('hard');
|
i = AIEngine.playAI('hard');
|
||||||
lastMove = i + 1;
|
lastMove = i + 1;
|
||||||
continue;
|
} else {
|
||||||
|
i = Number.parseInt(choice, 10) - 1;
|
||||||
|
AIEngine.play(i);
|
||||||
|
lastMove = i + 1;
|
||||||
}
|
}
|
||||||
i = Number.parseInt(choice, 10) - 1;
|
|
||||||
AIEngine.play(i);
|
|
||||||
lastMove = i + 1;
|
|
||||||
}
|
}
|
||||||
board[colLevels[i]][i] = sign;
|
board[colLevels[i]][i] = sign;
|
||||||
colLevels[i]--;
|
colLevels[i]--;
|
||||||
|
|||||||
Reference in New Issue
Block a user