mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 13:53:12 +02:00
Fix
This commit is contained in:
@@ -108,9 +108,13 @@ module.exports = class TicTacToeCommand extends Command {
|
||||
const newBoard = [[], [], []];
|
||||
let col = 0;
|
||||
for (const piece of board) {
|
||||
if (piece === 'X') newBoard[col].push('x');
|
||||
if (piece === 'O') newBoard[col].push('o');
|
||||
newBoard[col].push('_');
|
||||
if (piece === 'X') {
|
||||
newBoard[col].push('x');
|
||||
} else if (piece === 'O') {
|
||||
newBoard[col].push('o');
|
||||
} else {
|
||||
newBoard[col].push('_');
|
||||
}
|
||||
if (newBoard[col].length === 3) col++;
|
||||
}
|
||||
return newBoard;
|
||||
|
||||
Reference in New Issue
Block a user