public void init(Map map) {
        for (int i = 0; i < map.getBlocks().length; i++) {
            buttons[i].setText("");

            buttons[i].setBorder(new LineBorder(Color.lightGray, 1));
            if (!map.getBlocks()[i].isVisible()) {
                buttons[i].setBackground(Color.gray);
            } else if (map.getBlocks()[i].getBlocktype() == BLOCKTYPE.DEFAULT) {
                buttons[i].setBackground(Color.WHITE);
            } else if (map.getBlocks()[i].getBlocktype() == BLOCKTYPE.HAZARD) {
                buttons[i].setBackground(Color.red);
            } else if (map.getBlocks()[i].getBlocktype() == BLOCKTYPE.COLORBLOB) {
                buttons[i].setBackground(Color.yellow);
            }
            if (map.getRobot() != null && map.getRobot().toID() == i) {
                buttons[i].setText("O");
                continue;
            }

            if (map.getGoal() != null && map.getGoal().toID() == i) {
                buttons[i].setText("X");
            }
        }
    }