From 1e643eb08a4ba0548bfc73098af3243d664463be Mon Sep 17 00:00:00 2001 From: fdai7727 Date: Thu, 25 Jan 2024 21:00:50 +0100 Subject: [PATCH] =?UTF-8?q?Verschieben=20der=20define=20Variablen=20in=20d?= =?UTF-8?q?ie=20.h-Datei,=20sodass=20sie=20ebenfalls=20f=C3=BCr=20die=20Te?= =?UTF-8?q?stdatei=20verf=C3=BCgbar=20ist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/Tim/hangman.c | 6 +----- src/main/c/Tim/hangman.h | 5 +++++ src/test/c/Tim/test_hangman.c | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/c/Tim/hangman.c b/src/main/c/Tim/hangman.c index 96ecc80..427f788 100644 --- a/src/main/c/Tim/hangman.c +++ b/src/main/c/Tim/hangman.c @@ -6,11 +6,7 @@ #include #include -#define LISTSIZE 30 -#define MAX_WORD_LENGTH 30 -#define STAGENUM 7 -#define ASCII_ART_SIZE 1000 -#define POSSIBLE_TRYS 6 + char wordlist[LISTSIZE][MAX_WORD_LENGTH] = { diff --git a/src/main/c/Tim/hangman.h b/src/main/c/Tim/hangman.h index 45feb3e..732f005 100644 --- a/src/main/c/Tim/hangman.h +++ b/src/main/c/Tim/hangman.h @@ -2,6 +2,11 @@ #ifndef HANGMAN_H #define HANGMAN_H +#define LISTSIZE 30 +#define MAX_WORD_LENGTH 30 +#define STAGENUM 7 +#define ASCII_ART_SIZE 1000 +#define POSSIBLE_TRYS 6 void hangman(); char* getWordFromList(int); diff --git a/src/test/c/Tim/test_hangman.c b/src/test/c/Tim/test_hangman.c index 4e6d98e..0ddb407 100644 --- a/src/test/c/Tim/test_hangman.c +++ b/src/test/c/Tim/test_hangman.c @@ -43,7 +43,7 @@ void test_getWordFromList_Kleiderschrank_5() void test_getWordFromList_IndexOutOfList() { //arrange - int pos = 60; + int pos = LISTSIZE+1; char expectedResult[] = "Index nicht vorhanden"; //act char actualResult[30];