Fix Some Bugs

This commit is contained in:
Dragon Fire
2020-03-17 17:04:21 -04:00
parent f9bece1eb2
commit 060e03075b
+4 -4
View File
@@ -79,8 +79,8 @@ module.exports = class ConnectFourCommand extends Command {
break; break;
} }
const i = Number.parseInt(choice, 10) - 1; const i = Number.parseInt(choice, 10) - 1;
board[i][5 - board[i][6]] = sign; board[i][board[i][6]] = sign;
board[i][6] += 1; board[i][6] -= 1;
if (this.verifyWin(board)) winner = userTurn ? msg.author : opponent; if (this.verifyWin(board)) winner = userTurn ? msg.author : opponent;
userTurn = !userTurn; userTurn = !userTurn;
} }
@@ -122,8 +122,8 @@ module.exports = class ConnectFourCommand extends Command {
generateBoard() { generateBoard() {
const arr = []; const arr = [];
for (let i = 0; i < 7; i++) { for (let i = 0; i < 6; i++) {
arr.push([null, null, null, null, null, null, 0]); arr.push([null, null, null, null, null, null, 5]);
} }
return arr; return arr;
} }