|
|
@ -21,8 +21,9 @@ void quadrat(){ |
|
|
|
char Quadrat[arraySize]; |
|
|
|
befuellenDesArraysMitX(Quadrat, arraySize); |
|
|
|
befuelleArrayMitLeerzeichen(Quadrat, arraySize); |
|
|
|
befuelleArrayMitZeilenumbruechen(Quadrat,groesse); |
|
|
|
|
|
|
|
|
|
|
|
printf("\n%s", Quadrat); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -37,7 +38,7 @@ return 0; |
|
|
|
void auswahlDerArt(int pick){ |
|
|
|
switch (pick) { |
|
|
|
case (1): |
|
|
|
return quadrat(); |
|
|
|
quadrat(); |
|
|
|
break; |
|
|
|
case (2): |
|
|
|
|
|
|
@ -79,7 +80,18 @@ void befuelleArrayMitLeerzeichen(char quadraT[], int laenge){ |
|
|
|
if(i % 2 != 0){ |
|
|
|
quadraT[i] = ' '; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
quadraT[laenge-1] = '\0'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void befuelleArrayMitZeilenumbruechen(char quadraT[], int laenge){ |
|
|
|
|
|
|
|
int zeile = 2 * laenge; |
|
|
|
int laengeGesamt = zeile * laenge; |
|
|
|
for (int i = 0; i < laengeGesamt; i++){ |
|
|
|
if((i + 1) % zeile == 0){ |
|
|
|
quadraT[i] = '\n'; |
|
|
|
} |
|
|
|
} |
|
|
|
quadraT[laengeGesamt-1] = '\0'; |
|
|
|
} |