|
|
@ -85,32 +85,36 @@ int update(int realU[N][N],char richtung) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(richtung == 'u') { |
|
|
|
if(ii == 0) { |
|
|
|
return 1; |
|
|
|
} |
|
|
|
if(realU[ii + 1] [jj] == (N * N) + 1) { |
|
|
|
realU[ii + 1] [jj] = groesste + 1; |
|
|
|
apple(realU); |
|
|
|
speed = speed + 20; |
|
|
|
} |
|
|
|
else { |
|
|
|
if(!lose(realU, richtung)) { |
|
|
|
if(richtung == 'u') { |
|
|
|
if(ii == 0) { |
|
|
|
return 1; |
|
|
|
} |
|
|
|
if(realU[ii + 1] [jj] == (N * N) + 1) { |
|
|
|
realU[ii + 1] [jj] = groesste + 1; |
|
|
|
apple(realU); |
|
|
|
speed = speed + 20; |
|
|
|
} |
|
|
|
else { |
|
|
|
if(!lose(realU, richtung)) { |
|
|
|
realU[ii - 1][jj] = groesste + 1; |
|
|
|
for (int i = 0; i < N; i++) { |
|
|
|
for (int j = 0; j < N; j++) { |
|
|
|
if (realb[i][j] != 0 && realb[i][j] != (N * N) + 1) { |
|
|
|
realb[i][j]--; |
|
|
|
for (int i = 0; i < N; i++) { |
|
|
|
for (int j = 0; j < N; j++) { |
|
|
|
if (realb[i][j] != 0 && realb[i][j] != (N * N) + 1) { |
|
|
|
realb[i][j]--; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
return 1; |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
} |
|
|
|
else if (richtung == 'd') { |
|
|
|
if (ii == N - 1) { |
|
|
|
return 1; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int probe(int input){ |
|
|
|
return input; |
|
|
|