mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-27 06:37:32 +02:00
Fix Some Bugs
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user