From 2fc84c29d2bf1d04363caaf7700cdb301946b6ce Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Thu, 1 Mar 2018 19:38:41 +0000 Subject: [PATCH] This still looks ugly --- commands/games/tic-tac-toe.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/games/tic-tac-toe.js b/commands/games/tic-tac-toe.js index c3d5bdab..56583bdf 100644 --- a/commands/games/tic-tac-toe.js +++ b/commands/games/tic-tac-toe.js @@ -69,16 +69,16 @@ module.exports = class TicTacToeCommand extends Command { } else { sides[Number.parseInt(choice, 10)] = sign; taken.push(choice); - if ((sides[0] === sides[1] && sides[0] === sides[2]) + if ( + (sides[0] === sides[1] && sides[0] === sides[2]) || (sides[0] === sides[3] && sides[0] === sides[6]) || (sides[3] === sides[4] && sides[3] === sides[5]) || (sides[1] === sides[4] && sides[1] === sides[7]) || (sides[6] === sides[7] && sides[6] === sides[8]) || (sides[2] === sides[5] && sides[2] === sides[8]) || (sides[0] === sides[4] && sides[0] === sides[8]) - || (sides[2] === sides[4] && sides[2] === sides[6])) { - winner = userTurn ? msg.author : opponent; - } + || (sides[2] === sides[4] && sides[2] === sides[6]) + ) winner = userTurn ? msg.author : opponent; userTurn = !userTurn; } }