Guest User

Untitled

a guest
Dec 11th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. public static void main(String args[]) throws IOException
  2. {
  3. char[] board = new char[9];
  4. boolean turn = true;
  5.  
  6. int moveNum;
  7. int moveCount = 0;
  8. String inputMove;
  9. BufferedReader dataIn = new BufferedReader(new InputStreamReader(System.in));
  10.  
  11.  
  12. while (moveCount < 9) {
  13.  
  14.  
  15. if (turn == true) {
  16.  
  17. System.out.println("Enter your move, Player 1: ");
  18. inputMove = dataIn.readLine();
  19. moveNum = Integer.parseInt(inputMove);
  20. player1(moveNum, board);
  21. turn = false;
  22. moveCount++;
  23.  
  24. }
  25. else {
  26. System.out.println("Enter your move, Player 2: ");
  27. inputMove = dataIn.readLine();
  28. moveNum = Integer.parseInt(inputMove);
  29. player2(moveNum, board);
  30. turn = true;
  31. moveCount++;
  32.  
  33. }
Add Comment
Please, Sign In to add comment