|
|
@ -124,6 +124,14 @@ public class TicTacToeGame implements ActionListener { |
|
|
|
{ |
|
|
|
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 |
|
|
|
private void oWin(int i, int i1, int i2) { |
|
|
|