|
|
@ -11,6 +11,7 @@ void Umgebung(int str[N][N]); |
|
|
|
void delay(int ms); |
|
|
|
|
|
|
|
int main(){ |
|
|
|
|
|
|
|
srand(time(0));// damit wir ein Zufallszahl haben. |
|
|
|
|
|
|
|
int realU[N][N];// für eine Schlange |
|
|
@ -53,20 +54,27 @@ void Umgebung(int str[N][N]){ |
|
|
|
printf("\n"); |
|
|
|
printf("\t\033[96mHerzlichen Willkommen zum Spiel: SNAKE \033[0m\n"); |
|
|
|
printf("\n"); |
|
|
|
|
|
|
|
for (int i=0;i<N;i++){ |
|
|
|
for(int j=0;j<N;j++){ |
|
|
|
if(str[i][j]==(N*N)+1)printf("* "); |
|
|
|
else if (str[i][j]==0)printf("0 "); |
|
|
|
else printf("1 "); |
|
|
|
|
|
|
|
} |
|
|
|
printf("\n"); |
|
|
|
} |
|
|
|
printf("\033[96m%c\033[0m", 218); |
|
|
|
for (int i = 0; i < N * 2 + 2; i++)printf("\033[96m%c\033[0m", 95); |
|
|
|
printf("\033[96m%c\n\033[0m", 191); |
|
|
|
for (int i = 0; i < N; i++) { |
|
|
|
printf("\033[96m%c \033[0m", 179); |
|
|
|
for (int j = 0; j < N; j++) { |
|
|
|
|
|
|
|
if (str[i][j] == (N * N) + 1)printf("\033[91m%c%c\033[0m", 222, 221); |
|
|
|
else if (str[i][j] == 0)printf(" "); |
|
|
|
else printf("\033[93m%c%c\033[0m", 219, 219); |
|
|
|
} |
|
|
|
printf("\033[96m %c \033[0m", 179); |
|
|
|
printf("\n"); |
|
|
|
} |
|
|
|
printf("\033[96m%c\033[0m", 192); |
|
|
|
for (int i = 0; i < N * 2 + 2; i++)printf("\033[96m%c\033[0m", 95); |
|
|
|
printf("\033[96m%c\n\033[0m", 217); |
|
|
|
delay(100000); //damit wir die Änderungs wahrnehmen können |
|
|
|
printf("\n"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void Apfel(int realU[N][N]){ |
|
|
|
int ii,jj; |
|
|
|
while (true) |
|
|
|