https://pastein.ru/t/tW

  скопируйте уникальную ссылку для отправки

Загрузка данных


	private boolean compHodit()
	{
		boolean rez = false;
		boolean flag = false;
		_for1: for (int i=0;i<10;i++ ) {
			for (int j=0;j<10;j++ ) {
				if ((masPlay[i][j]>=9) && (masPlay[i][j]<=11))
				{
					flag = true;
					if (testMasPoz(i-1,j)&&(masPlay[i-1][j]<=4)&&(masPlay[i-1][j]!=-2))
					{
						masPlay[i-1][j]+=7;
						testUbit(masPlay,i-1,j);
						if (masPlay[i-1][j]>=8) rez = true;
						break _for1; // WO ZA ZNAK TYT? _FOR1;
					}
					else if (testMasPoz(i+1,j)&&(masPlay[i+1][j]<=4)&&(masPlay[i+1][j]!=-2)) 
					{
						masPlay[i+1][j]+=7;
						testUbit(masPlay,i+1,j);
						if (masPlay[i+1][j]>=8) rez=true;
						break _for1; // I TYT WO ZA ZNAK?
					}
					if (testMasPoz(i,j-1)&&(masPlay[i][j-1]<=4)&&(masPlay[i][j-1]!=-2))
					{
						masPlay[i][j-1]+=7;
						testUbit(masPlay,i,j-1);
						if (masPlay[i][j-1]>=8) rez = true;
						break _for1; // WO ZA ZNAK TYT? _FOR1;
					}
					else if (testMasPoz(i,j+1)&&(masPlay[i][j+1]<=4)&&(masPlay[i][j+1]!=-2)) 
					{
						masPlay[i][j+1]+=7;
						testUbit(masPlay,i,j+1);
						if (masPlay[i][j+1]>=8) rez=true;
						break _for1; // I TYT WO ZA ZNAK?
					}
				}
			}
		}
		if (flag==false) {
			for (int k=1;k<=100;k++ ) {
				int i = (int)(Math.random()*10);
				int j = (int)(Math.random()*10);
				if ((masPlay[i][j]<=4)&&(masPlay[i][j]!=-2)) {
						masPlay[i][j]+=7;
						testUbit(masPlay,i,j);
						if (masPlay[i][j]>=8) rez=true;
						break; // I TYT WO ZA ZNAK?
				}
			}
		if (flag==false) {
			_for2: for (int i=0;i<10;i++) {
				for (int j=0;j<10;j++) {
					if ((masPlay[i][j]<=4)&&(masPlay[i][j]!=-2)) {
						masPlay[i][j]+=7;
						testUbit(masPlay,i,j);
						if (masPlay[i][j]>=8) rez=true;
						break _for2; // I TYT WO ZA ZNAK?
					}
				}
			}
		}
	}
	testEndGame();
	return rez;
	}