From 90d5fd94c635741300b354a19f6310f4b709eb79 Mon Sep 17 00:00:00 2001 From: fdai7225 Date: Mon, 23 Jan 2023 16:36:47 +0100 Subject: [PATCH] =?UTF-8?q?Vorbereitung=20der=20Umgebung=20f=C3=BCr=20die?= =?UTF-8?q?=20Schlange?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Umgebung.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/Umgebung.c b/src/Umgebung.c index 72e4222..3a84e57 100644 --- a/src/Umgebung.c +++ b/src/Umgebung.c @@ -1,22 +1,25 @@ #define _CRT_SECURE_NO_WARNINGS #define re return +#define N 40 #include #include #include #include #include -#define N 40 void Umgebung(char str[N][N]); void delay(int ms); int main(){ + char str[N][N]; + + printf("geben Sie die Richtung: ") ; char g; + + while((g=getchar())!=EOF){ - - char str[N][N]; Umgebung(str); } @@ -30,7 +33,7 @@ void delay(int ms){ } void Umgebung(char str[N][N]){ - + int realU[N][N]; system("cls"); printf("\n"); printf("\tHerzlichen Willkommen zum Spiel \n"); @@ -40,12 +43,16 @@ void Umgebung(char str[N][N]){ for(int j=0;j<=N;j++){ if((i==0)||(j==0)||(i==N)||(j==N)){ str[i][j]= '+'; - printf("%c",str[i][j]);} + printf("%c ",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"); } - delay(1000); + delay(100); printf("\n"); + } \ No newline at end of file