Browse Source

Tic Tac Toe updating method chek

remotes/origin/develop
fdai6040 2 years ago
parent
commit
c00f2d71db
  1. 12
      src/main/java/src/TicTacToeGame.java

12
src/main/java/src/TicTacToeGame.java

@ -96,6 +96,18 @@ public class TicTacToeGame implements ActionListener {
{
xWin(0, 3, 6);
}
else if ((bton[1].getText() == "X") && (bton[4].getText() == "X") && (bton[7].getText() == "X"))
{
xWin(1, 4, 7);
}
else if ((bton[2].getText() == "X") && (bton[4].getText() == "X") && (bton[6].getText() == "X"))
{
xWin(2, 4, 6);
}
else if ((bton[2].getText() == "X") && (bton[5].getText() == "X") && (bton[8].getText() == "X"))
{
xWin(2, 5, 8);
}
}

Loading…
Cancel
Save