Guest User

Untitled

a guest
Jan 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public void actionPerformed(ActionEvent e) {
  2. Control.incrementValue();// changes from X to O
  3. if (ok) { //to not override a cell
  4. switch (Control.getValue() % 2) {
  5. case 0:
  6. setIcon(X);
  7. value=0;
  8. break;
  9. case 1:
  10. setIcon(O);
  11. value=1;
  12. break;
  13. }
  14. ok = false;
  15. }
  16. if(Control.gameOver()){
  17. Control.endGame();
  18. }
  19.  
  20. }
Add Comment
Please, Sign In to add comment