public void Write() 
    {
        copyArray();

        try{
            File f=new File("map_FILE");
            RandomAccessFile randomFile=new RandomAccessFile(f,"rw");
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            for (int x = 0; x < 22; x++)
            {
                for(int y = 0; y < 22; y++)
                {
                    int tempX =  map[x][y].returnX();
                    int tempY =  map[x][y].returnY();
                    boolean Temphouse = false;
                    boolean Temphosp = false;
                    boolean Temproad = false;
                    String tempXS = Integer.toString(tempX);
                    String tempYS = Integer.toString(tempY);

                    if (map[x][y].HouseCheck()){Temphouse = true;}
                    if (map[x][y].RoadCheck()){Temproad = true;}
                    if (map[x][y].HospitalCheck()){Temphosp = true;}

                    randomFile.seek(f.length());
                    randomFile.writeInt(tempX);
                    randomFile.writeInt(tempY);
                    randomFile.writeBoolean(Temphouse);
                    randomFile.writeBoolean(Temphosp);
                    randomFile.writeBoolean(Temproad);

                }
            }
            randomFile.close();
        }
        catch(Exception e){}

    }