Class BoggleBoard

java.lang.Object
  extended by BoggleBoard

public class BoggleBoard
extends java.lang.Object

Represent a Boggle Board to play a game of Boggle.


Constructor Summary
BoggleBoard(java.lang.String[] faces)
          Create a square boggle board from an array of Strings/Cube faces.
 
Method Summary
 java.lang.String getFace(int row, int col)
          Return the cube face at specified location, this will be a one-character string, presumably, or "Qu" for a Q-cube.
 int size()
          Returns dimension of a square board, e.g., 4 or 5 for Boggle or Big Boggle, respectively.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BoggleBoard

public BoggleBoard(java.lang.String[] faces)
Create a square boggle board from an array of Strings/Cube faces. The array should contain sizexsize entries, e.g., 16 for a 4x4 Boggle game.

Parameters:
faces - is row-major order of cubes used in the board for Boggle
Method Detail

size

public int size()
Returns dimension of a square board, e.g., 4 or 5 for Boggle or Big Boggle, respectively.

Returns:
size of board

getFace

public java.lang.String getFace(int row,
                                int col)
Return the cube face at specified location, this will be a one-character string, presumably, or "Qu" for a Q-cube.

Parameters:
row - is row of cube whose face is returned
col - is column of cube whose face is returned
Returns:
String/face of specified cube
Throws:
java.lang.ArrayIndexOutOfBoundsException - if cube location isn't valid

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object