|
@ -1,6 +1,5 @@ |
|
|
#include "ASCII_art.h" |
|
|
#include "ASCII_art.h" |
|
|
#include <stdio.h> |
|
|
#include <stdio.h> |
|
|
#include <stdlib.h> |
|
|
|
|
|
|
|
|
|
|
|
int ASCII_Art(){ |
|
|
int ASCII_Art(){ |
|
|
|
|
|
|
|
@ -19,7 +18,9 @@ void quadrat(){ |
|
|
int groesse; |
|
|
int groesse; |
|
|
scanf("%d", &groesse); |
|
|
scanf("%d", &groesse); |
|
|
int arraySize = berechnungDerLaengeDesQuadratArrays(groesse); |
|
|
int arraySize = berechnungDerLaengeDesQuadratArrays(groesse); |
|
|
|
|
|
|
|
|
|
|
|
char Quadrat[arraySize]; |
|
|
|
|
|
befuellenDesArraysMitX(Quadrat, arraySize); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -34,7 +35,7 @@ return 0; |
|
|
void auswahlDerArt(int pick){ |
|
|
void auswahlDerArt(int pick){ |
|
|
switch (pick) { |
|
|
switch (pick) { |
|
|
case (1): |
|
|
case (1): |
|
|
quadrat(); |
|
|
|
|
|
|
|
|
return quadrat(); |
|
|
break; |
|
|
break; |
|
|
case (2): |
|
|
case (2): |
|
|
|
|
|
|
|
@ -58,4 +59,12 @@ int berechnungDerLaengeDesQuadratArrays(int anzahlDerX){ |
|
|
// länge des Arrays für ein Quadrat |
|
|
// länge des Arrays für ein Quadrat |
|
|
|
|
|
|
|
|
return ArraygroesseDesQuadrats; |
|
|
return ArraygroesseDesQuadrats; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void befuellenDesArraysMitX(char quadraT[], int laenge){ |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < laenge; i++){ |
|
|
|
|
|
quadraT[i] = 'X'; |
|
|
|
|
|
} |
|
|
|
|
|
quadraT[laenge-1] = '\0'; |
|
|
} |
|
|
} |