import java.util.*;

public class TicTacToeStub
{

    static Scanner input = new Scanner(System.in);
    final static int ROWS = 3;
    final static int COLS = 3;


    // Precondition:  board is a ROWSxCOLS tic-tac-toe board
    //                player is either 'X' or 'O'
    //
    // Postcondition: displays board
    //                asks player to make a move & makes move
    //                prints win or tie if player wins
    //                returns true if win or tie
    //                returns false otherwise
    public static boolean doPlayer(char board[][], char player)
    {
            board = new char[ROWS][COLS];
            boolean result = false;

            display(board);
            makeMove(board, player);
            display(board);

            if (isWinner(board, player))
            {
                System.out.println(player + " wins!");
                result = true;
            }
            else if (isFull(board))
            {
                System.out.println("Tie!");
                result = true;
            }

            return result;
    }

    // Precondition:  array is an array of SIZE rows
    //                with COLS characters per row
    //
    // Postcondition: All entries in ARRAY are set to VALUE
    //
    public static void initialize(char board[][], char value)
    {
            System.out.println("Initializing board!");
    }

    // Precondition:  board is a ROWSxCOLS tic-tac-toe board
    //
    // Postcondition: displays the contents of board on scren
    public static void display(char board[][])
    {
            System.out.println("Displaying board!");
    }

    // Precondition:  board is a ROWSxCOLS tic-tac-toe board
    //                player is either 'X' or 'O'
    //
    // Postcondition: prompts player for an x,y position on board
    //                attempts to place player's X or O at that position
    //                if attempt fails, then tries again
    //				  on return board contains a new move for player
    public static void makeMove(char board[][], char player)
    {
            int x=0;
            int y=0;
            char play = player;

            System.out.println("Enter x,y for player " + player + " : ");
            x = input.nextInt();
            y = input.nextInt();
    }

    // Precondition:  board is a ROWSxCOLS tic-tac-toe board
    //                player is either 'X' or 'O'
    //
    // Postcondition: returns true if player has won game 
    //                returns false otherwise
    //                A win is defined as:
    //                  player appears in each colum for a row
    //                  player appears in each row for a column
    //                  player appears in either diagonal
    public static boolean isWinner(char board[][], char player)
    {
            System.out.append("Checking if " + player + " is winner!");
            return false;
    }

    // Precondition:  board is a ROWSxCOLS tic-tac-toe board
    //
    // Postcondition: returns true if the board is full (no player moves left)
    //                returns false otherwise
    public static boolean isFull(char board[][])
    {
            System.out.println("Checking if board is full!");
            return false;
    }

    public static void main(String[]args)
    {
            char board[][] = new char [ROWS][COLS];

            // Initialize the board.
            initialize(board,' ');

            // Loop forever until win/tie
            while (true)
            {
                    // Did Player X win/tie?
                    if (doPlayer(board, 'X'))
                    {
                            break;
                    }
                    // Did Player O win/tie?
                    else if (doPlayer(board, 'O'))
                    {
                            break;
                    }
            }
    }
}