From d178e5af58f4c3070d9cbaa4d2f5618700e3c25f Mon Sep 17 00:00:00 2001 From: fdai6040 Date: Tue, 7 Feb 2023 11:41:17 +0100 Subject: [PATCH] Tic Tac Toe updated chek method to print "Game Draw", if chance_flag 9 --- src/main/java/src/TicTacToeGame.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/src/TicTacToeGame.java b/src/main/java/src/TicTacToeGame.java index e2ac040..0278fe7 100644 --- a/src/main/java/src/TicTacToeGame.java +++ b/src/main/java/src/TicTacToeGame.java @@ -145,8 +145,9 @@ public class TicTacToeGame implements ActionListener { else if ((bton[6].getText() == "O") && (bton[7].getText() == "O") && (bton[8].getText() == "O")) { oWin(6, 7, 8); - } - else if ((bton[3].getText()== "O") && (bton[4].getText() == "O") && (bton[5].getText() == "O")) + } else if (chance_flag==9) { + textfield.setText("Game Draw :)"); + } else if ((bton[3].getText()== "O") && (bton[4].getText() == "O") && (bton[5].getText() == "O")) oWin(3,4,5); }