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