Browse Source

refactoring: Definieren der Konstanten STAGENUM und ASCII_ART_SIZE

remotes/origin/tim
fdai7727 11 months ago
parent
commit
9709a76863
  1. 6
      src/main/c/Tim/hangman.c

6
src/main/c/Tim/hangman.c

@ -8,6 +8,8 @@
#define LISTSIZE 10
#define MAX_WORD_LENGTH 30
#define STAGENUM 7
#define ASCII_ART_SIZE 1000
char wordlist[LISTSIZE][MAX_WORD_LENGTH] = {
@ -16,7 +18,7 @@ char wordlist[LISTSIZE][MAX_WORD_LENGTH] = {
"Fernbedienung", "Computertastatur"
};
char hangmanStages[7][100]={
char hangmanStages[STAGENUM][ASCII_ART_SIZE]={
"+---+\n"
"| |\n"
"|\n"
@ -215,6 +217,6 @@ void changeLetter(char x, char y[], int length, char ptr[])
void drawHangman()
{
for(int i = 0; i<7;i++)
for(int i = 0; i<STAGENUM;i++)
printf("%s", hangmanStages[i]);
}
Loading…
Cancel
Save