public Wall look_ahead(int x, int y, int dx, int dy) {

        Cell horizontal = get_cell(x, y, dx, 0);
        Cell horizontal_neg_vertical = get_cell(x, y, dx, -dy);
        Cell vertical = get_cell(x, y, 0, dy);
        Cell vertical_neg_horizontal = get_cell(x, y, -dx, dy);
        Cell diagonal = get_cell(x, y, dx, dy);
        Cell current = get_cell(x, y, 0, 0);
        assert (current != Cell.OUT) : "current is OUT, x=" + x
                + ", y=" + y + ", w=" + width + ", h=" + height;
        if (diagonal == current) {
            return Wall.SPACE;
        } else if (horizontal == current && vertical == current) {
            return Wall.CORNER;
        } else if (horizontal != current && vertical != current) {
            return Wall.CORNER;
        } else if (horizontal == current && horizontal_neg_vertical == current) {
            return Wall.HORIZONTAL_WALL;
        } else if (vertical == current && vertical_neg_horizontal == current) {
            return Wall.VERTICAL_WALL;
        } else {
            return Wall.CORNER;
        }
    }