public int minimax(int depth)
	{
		Minimax mnx = new Minimax();
		int i=0;
		boolean flag;
		try {
			i = mnx.findBestMove(this, depth);
		} catch (CloneNotSupportedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		Model2048 m = new Model2048(this);
		int temp = 0;
		switch(i){
		case 0:
			flag=m.MoveUp();
			if (flag == false)
				temp=1;
			else
				temp=0;
			break;
		case 1:
			flag=m.MoveDown();
			if (flag == false)
				temp=0;
			else
				temp=1;
			break;
		case 2:
			flag=m.MoveLeft();
			if (flag == false)
				temp=3;
			else
				temp=2;
			break;
		case 3:
			flag=m.MoveRight();
			if (flag == false)
				temp=2;
			else
				temp=3;
			break;
		}
		setChanged();
		notifyObservers();
		return temp;
	}