From 05def41195e9f891f121ac5b362d00a1cfc6b8c4 Mon Sep 17 00:00:00 2001 From: fdai6040 Date: Tue, 7 Feb 2023 10:52:50 +0100 Subject: [PATCH] Tic Tac Toe update chek method for buttons 2-4-6 if 0 wins --- src/main/java/src/TicTacToeGame.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/src/TicTacToeGame.java b/src/main/java/src/TicTacToeGame.java index ea213a1..8613662 100644 --- a/src/main/java/src/TicTacToeGame.java +++ b/src/main/java/src/TicTacToeGame.java @@ -132,6 +132,12 @@ public class TicTacToeGame implements ActionListener { { oWin(1, 4, 7); } + + else if ((bton[2].getText() == "O") && (bton[4].getText() == "O") && (bton[6].getText() == "O")) + { + oWin(2, 4, 6); + } + } //method if player 0 wins private void oWin(int i, int i1, int i2) {