private static void saveWorld(Cell[][] cells){
		try {
			File mapfile = new File("automap.txt");
			BufferedWriter mapout = new BufferedWriter(new FileWriter(mapfile));
			mapout.write(Integer.toString(cells[0].length));
			mapout.newLine();
			mapout.write(Integer.toString(cells.length));
			mapout.newLine();
			for (int i = 0; i < cells.length; i++){
				// Indent every second line
				if (i % 2 == 1){
					mapout.write(" ");
				}
				for (int j = 0; j < cells[0].length; j++){
					switch(cells[j][i].getTerrain()){
						case ROCKY:
							mapout.write("#");
							break;
						case RED_ANTHILL:
							mapout.write("+");
							break;
						case BLACK_ANTHILL:
							mapout.write("-");
							break;
						case CLEAR:
							if (cells[j][i].getFoodAmount() == 0){
								mapout.write(".");
							} else {
								mapout.write(Integer.toString(cells[j][i].getFoodAmount()));
							}
							break;
					}
					mapout.write(" "); //spaces between cells
				}
				mapout.newLine();
			}
			
			mapout.close();
		} catch (Exception e) {
			
		}
	}