Dimension getCoords(int action) {
		int ax=mx, ay=my;
		switch(action) {
			case 0: ay = my - 1; break;
			case 1: ay = my - 1; ax = mx + 1; break;
			case 2: ax = mx + 1; break;
			case 3: ay = my + 1; ax = mx + 1; break;
			case 4: ay = my + 1; break;
			case 5: ay = my + 1; ax = mx - 1; break;
			case 6: ax = mx - 1; break;
			case 7: ay = my - 1; ax = mx - 1; break;
			default: //System.err.println("Invalid action: "+action);
		}
		return new Dimension(ax, ay);
	}