From 9709a768636810cded5b48cec7c8814ee5e41020 Mon Sep 17 00:00:00 2001 From: fdai7727 Date: Thu, 25 Jan 2024 20:35:55 +0100 Subject: [PATCH] refactoring: Definieren der Konstanten STAGENUM und ASCII_ART_SIZE --- src/main/c/Tim/hangman.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/c/Tim/hangman.c b/src/main/c/Tim/hangman.c index 76b825c..7db0052 100644 --- a/src/main/c/Tim/hangman.c +++ b/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