Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String args[]) throws IOException
- {
- char[] board = new char[9];
- boolean turn = true;
- int moveNum;
- int moveCount = 0;
- String inputMove;
- BufferedReader dataIn = new BufferedReader(new InputStreamReader(System.in));
- while (moveCount < 9) {
- if (turn == true) {
- System.out.println("Enter your move, Player 1: ");
- inputMove = dataIn.readLine();
- moveNum = Integer.parseInt(inputMove);
- player1(moveNum, board);
- turn = false;
- moveCount++;
- }
- else {
- System.out.println("Enter your move, Player 2: ");
- inputMove = dataIn.readLine();
- moveNum = Integer.parseInt(inputMove);
- player2(moveNum, board);
- turn = true;
- moveCount++;
- }
Add Comment
Please, Sign In to add comment