|
@ -1,22 +1,25 @@ |
|
|
#define _CRT_SECURE_NO_WARNINGS |
|
|
#define _CRT_SECURE_NO_WARNINGS |
|
|
#define re return |
|
|
#define re return |
|
|
|
|
|
#define N 40 |
|
|
#include<stdio.h> |
|
|
#include<stdio.h> |
|
|
#include<string.h> |
|
|
#include<string.h> |
|
|
#include<stdlib.h> |
|
|
#include<stdlib.h> |
|
|
#include<time.h> |
|
|
#include<time.h> |
|
|
#include<stdbool.h> |
|
|
#include<stdbool.h> |
|
|
|
|
|
|
|
|
#define N 40 |
|
|
|
|
|
void Umgebung(char str[N][N]); |
|
|
void Umgebung(char str[N][N]); |
|
|
void delay(int ms); |
|
|
void delay(int ms); |
|
|
|
|
|
|
|
|
int main(){ |
|
|
int main(){ |
|
|
|
|
|
|
|
|
|
|
|
char str[N][N]; |
|
|
|
|
|
|
|
|
|
|
|
printf("geben Sie die Richtung: ") ; |
|
|
char g; |
|
|
char g; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while((g=getchar())!=EOF){ |
|
|
while((g=getchar())!=EOF){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char str[N][N]; |
|
|
|
|
|
Umgebung(str); |
|
|
Umgebung(str); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -30,7 +33,7 @@ void delay(int ms){ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
void Umgebung(char str[N][N]){ |
|
|
void Umgebung(char str[N][N]){ |
|
|
|
|
|
|
|
|
|
|
|
int realU[N][N]; |
|
|
system("cls"); |
|
|
system("cls"); |
|
|
printf("\n"); |
|
|
printf("\n"); |
|
|
printf("\tHerzlichen Willkommen zum Spiel \n"); |
|
|
printf("\tHerzlichen Willkommen zum Spiel \n"); |
|
@ -40,12 +43,16 @@ void Umgebung(char str[N][N]){ |
|
|
for(int j=0;j<=N;j++){ |
|
|
for(int j=0;j<=N;j++){ |
|
|
if((i==0)||(j==0)||(i==N)||(j==N)){ |
|
|
if((i==0)||(j==0)||(i==N)||(j==N)){ |
|
|
str[i][j]= '+'; |
|
|
str[i][j]= '+'; |
|
|
printf("%c",str[i][j]);} |
|
|
|
|
|
|
|
|
printf("%c ",str[i][j]);} |
|
|
else {str[i][j]= ' '; |
|
|
else {str[i][j]= ' '; |
|
|
printf("%c",str[i][j]);} |
|
|
|
|
|
|
|
|
realU[i][j]=0; |
|
|
|
|
|
printf("%c",str[i][j]); |
|
|
|
|
|
printf("%d",realU[i][j]); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
printf("\n"); |
|
|
printf("\n"); |
|
|
} |
|
|
} |
|
|
delay(1000); |
|
|
|
|
|
|
|
|
delay(100); |
|
|
printf("\n"); |
|
|
printf("\n"); |
|
|
|
|
|
|
|
|
} |
|
|
} |