
/**
 * Write a description of class Board here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Board
{
    private static char[][] boardArray;


    public Board()
    {
        boardArray = new char[5][5];
    }
    
    public char getValue(int x, int y)
    {
        return boardArray[x][y];
    }
    
    public char getLeft(int x, int y){
          return boardArray[x-1][y];
    }
    
    public char get2Left(int x, int y){    
          return boardArray[x-2][y];
    }
    
    public char getRight(int x, int y){
          return boardArray[x+1][y];

    }
    
    public char get2Right(int x, int y){
          return boardArray[x+2][y];
    }
    
    public char getTop(int x, int y){
          return boardArray[x][y+1];
    }    
    
    public char getBottom(int x, int y){
          return boardArray[x][y-1];
    }        
    
    public static void insertPiece(char piece, int x, int y){
          boardArray[x][y] = piece;
    }    
    
    public boolean isFree(int x, int y){
        if(boardArray[x][y] == 'z'){ 
            return true;
        } else {
            return false;
        }
    }
    
    public static void initializeboard(String linefromfile){
        int x, y;
        int z = 1;
        for(x=1; x < 5; x++){
            for(y=1; y < 5; y++){
                insertPiece(linefromfile.charAt(z),y,x);
                z++;
            }
        }    
    }
}
