From ff9f8a8a0534d3f3e0c38379a22f0c29dd60a4c9 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 9 Jan 2021 13:05:40 -0500 Subject: [PATCH] Fix --- commands/games-mp/connect-four.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/games-mp/connect-four.js b/commands/games-mp/connect-four.js index 819cf944..fdda2ea0 100644 --- a/commands/games-mp/connect-four.js +++ b/commands/games-mp/connect-four.js @@ -77,14 +77,14 @@ module.exports = class ConnectFourCommand extends Command { let winner = null; const colLevels = [5, 5, 5, 5, 5, 5, 5]; let lastTurnTimeout = false; - let lastMove; + let lastMove = 'None'; while (!winner && board.some(row => row.includes(null))) { const user = userTurn ? msg.author : opponent; const sign = userTurn ? 'user' : 'oppo'; let i; if (opponent.bot && !userTurn) { i = AIEngine.playAI('hard'); - lastMove = i; + lastMove = i + 1; } else { await msg.say(stripIndents` ${user}, which column do you pick? Type \`end\` to forefeit. @@ -122,7 +122,7 @@ module.exports = class ConnectFourCommand extends Command { } i = Number.parseInt(choice, 10) - 1; if (AIEngine) AIEngine.play(i); - lastMove = i; + lastMove = i + 1; } board[colLevels[i]][i] = sign; colLevels[i]--;