Browse Source

Tic Tac Toe update chek method for buttons 0-4-8 1-4-7 if 0 wins

remotes/origin/develop
fdai6040 2 years ago
parent
commit
3ca90c9c37
  1. 8
      src/main/java/src/TicTacToeGame.java

8
src/main/java/src/TicTacToeGame.java

@ -124,6 +124,14 @@ public class TicTacToeGame implements ActionListener {
{ {
oWin(0, 3, 6); oWin(0, 3, 6);
} }
else if ((bton[0].getText() == "O") && (bton[4].getText() == "O") && (bton[8].getText() == "O"))
{
oWin(0, 4, 8);
}
else if ((bton[1].getText() == "O") && (bton[4].getText() == "O") && (bton[7].getText() == "O"))
{
oWin(1, 4, 7);
}
} }
//method if player 0 wins //method if player 0 wins
private void oWin(int i, int i1, int i2) { private void oWin(int i, int i1, int i2) {

Loading…
Cancel
Save