#ifndef _BOGGLEBOARD_H
#define _BOGGLEBOARD_H

#include <iostream>
using namespace std;

#include "tmatrix.h"

/**
 * This class represents a square grid of letters as used,
 * for example, in the game Boggle(tm)
 *
 * It's designed to be subclassed for creating boards
 * from different sources (e.g., read from file)
 *
 * Client programs using this class need only construct a board,
 * access individual characters as needed using charAt(..) and
 * print a board using print(...)
 *
 * Developers subclassing should override the init(..) function
 * to place characters in the board.  init(..) is called from the
 * constructor, [an example of the OO programming pattern Template]
 *
 *
 * char charAt(int row, int col)
 *    -- return character at position [row][col]
 *    -- return default character (non-alphabetic) if row/col out of bounds
 *
 * void print(ostream& out)
 *    -- print the board to out, one row per line
 *
 * int size()
 *    -- returns size of square board
 *
 */


class BoggleBoard
{
  public:

    BoggleBoard(int size);      // construct a square board, size X size
    virtual ~BoggleBoard();     // needed in inheritable classes
    
    virtual char charAt(int row, int col) const;   // returns char at [row][col]
    virtual void print(ostream& out)      const;   // prints board 
    virtual int  size()                   const;   // returns size of board
  protected:

    virtual void init();
    tmatrix<char>  myBoard;

};

#endif
