|
|
@ -7,22 +7,26 @@ |
|
|
|
#include<time.h> |
|
|
|
#include<stdbool.h> |
|
|
|
void Apfel(int realU[N][N]); |
|
|
|
void Umgebung(char str[N][N]); |
|
|
|
void Umgebung(int str[N][N]); |
|
|
|
void delay(int ms); |
|
|
|
|
|
|
|
int main(){ |
|
|
|
srand(time(0)); |
|
|
|
char str[N][N]; |
|
|
|
int realU[N][N]; |
|
|
|
for (int i=0;i<N;i++){ |
|
|
|
for(int j=0;j<N;j++){ |
|
|
|
str[i][j]='0'; |
|
|
|
realU[i][j]=0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
realU[0][0]=1; |
|
|
|
realU[0][1]=1; |
|
|
|
realU[0][2]=1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int realU[N][N]; |
|
|
|
|
|
|
|
printf("geben Sie die Richtung: ") ; |
|
|
|
char g=getchar(); |
|
|
|
Apfel(realU); |
|
|
@ -30,7 +34,7 @@ int main(){ |
|
|
|
if(g!=EOF){ |
|
|
|
while(true){ |
|
|
|
|
|
|
|
Umgebung(str); |
|
|
|
Umgebung(realU); |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
@ -42,8 +46,8 @@ void delay(int ms){ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
void Umgebung(char str[N][N]){ |
|
|
|
int realU[N][N]; |
|
|
|
void Umgebung(int str[N][N]){ |
|
|
|
|
|
|
|
system("cls"); |
|
|
|
printf("\n"); |
|
|
|
printf("\tHerzlichen Willkommen zum Spiel \n"); |
|
|
@ -51,7 +55,7 @@ void Umgebung(char str[N][N]){ |
|
|
|
|
|
|
|
for (int i=0;i<N;i++){ |
|
|
|
for(int j=0;j<N;j++){ |
|
|
|
printf("%c ",str[i][j]); |
|
|
|
printf("%d ",str[i][j]); |
|
|
|
|
|
|
|
} |
|
|
|
printf("\n"); |
|
|
|