From c00f2d71db0b7814b1bb3084084cee9235575e1a Mon Sep 17 00:00:00 2001 From: fdai6040 Date: Tue, 7 Feb 2023 10:22:54 +0100 Subject: [PATCH] Tic Tac Toe updating method chek --- src/main/java/src/TicTacToeGame.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/src/TicTacToeGame.java b/src/main/java/src/TicTacToeGame.java index 1814562..b86001f 100644 --- a/src/main/java/src/TicTacToeGame.java +++ b/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); + } }