Browse Source

TicTacToeGame message game over changed to "you lost"

remotes/origin/develop
fdai6040 2 years ago
parent
commit
e70030b0d5
  1. 6
      src/main/java/src/TicTacToeGame.java

6
src/main/java/src/TicTacToeGame.java

@ -86,7 +86,7 @@ public class TicTacToeGame implements ActionListener {
{
chance_flag = 0;
Object[] option={"Restart","Exit"};
int n=JOptionPane.showOptionDialog(frame, "Game Over\n"+s,"Game Over", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, option, option[0]);
int n=JOptionPane.showOptionDialog(frame, "You lost!\n"+s,"Game Over", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, option, option[0]);
if(n==0)
{
frame.dispose();
@ -165,7 +165,9 @@ public class TicTacToeGame implements ActionListener {
} else if (chance_flag==9) {
textfield.setText("Game Draw :)");
gameOver("Game Draw");
} else if ((bton[3].getText()== "O") && (bton[4].getText() == "O") && (bton[5].getText() == "O"))
}
else if ((bton[3].getText()== "O") && (bton[4].getText() == "O") && (bton[5].getText() == "O"))
oWin(3,4,5);
}

|||||||
100:0
Loading…
Cancel
Save