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