PacmanMaze.java
public String gridNull(int i, int j) {
        if (hasMonster(i,j)) {
            return GHOST_STRING;
        }
        else if ((i == p.getX()) && (j == p.getY())) {
            return PAC_STRING;  //elephant has precendence over traps.
        }
        else if(grid[i][j] == null) {
            return EMPTY;
        }
        else return ""; //empty space
    }
/**
     * A new function added such that if the game board 
     * contains a null Object (no Item there), then
     * continue to check for specific objects like monster
     * or player.
     * 
     * Including a function like this simplified toString a lot!
     **/
A new function added such that if the game board
contains a null Object (no Item there), then
continue to check for specific objects like monster
or player.

Including a function like this simplified toString a lot!
A new function added such that if the game board contains a null Object ( no Item there ) then continue to check for specific objects like monster or player . Including a function like this simplified toString a lot!
public String gridNull(int i, int j) {
        if (hasMonster(i,j)) {
            return GHOST_STRING;
        }
        else if ((i == p.getX()) && (j == p.getY())) {
            return PAC_STRING;  
        }
        else if(grid[i][j] == null) {
            return EMPTY;
        }
        else return ""; 
    }
public String gridNull ( int i , int j ) { if ( hasMonster ( i , j ) ) { return GHOST_STRING ; } else if ( ( i == p . getX ( ) ) && ( j == p . getY ( ) ) ) { return PAC_STRING ; } else if ( grid [ i ] [ j ] == null ) { return EMPTY ; } else return "" ; }
A new function added such that if the game board
 contains a null Object (no Item there), then
 continue to check for specific objects like monster
 or player.
A new function added such that if the game board contains a null Object ( no Item there ) then continue to check for specific objects like monster or player .
//elephant has precendence over traps. //empty space