/**
 * An interface for a class of objects representing tic-tac-toe boards.
 * @author Adam Shaw
 */

public interface TicTacToeBoard {

    /** returns true if the board is empty */
    public boolean isEmpty();

    /** returns the number of squares with Xs in them */
    public int numXs();

    /** returns the number of squares with Os in them */
    public int numOs();

    /** returns the number of occupied squares */
    public int numOccupied();

    /** returns the character in the given square
     * -- either 'X', 'O' or ' ' */
    public char charAt(int sq);

    /** returns either 'X' or 'O' */
    public char whoseTurn();

    /** returns true if "player" has three in a row */
    public boolean isWin(char player);

    /** returns true if the game is at a draw */
    public boolean isCatsGame();

    /** returns a new board, with "who" having moved to "where"
     *  if possible */
    public TicTacToeBoard move(char who, int where);

    /** returns a String representation of
     *  the current state of the board */
    public String marshal();

}
