From f1ae7bb8d6ab281ccb0c5bc514610ac38fb40403 Mon Sep 17 00:00:00 2001 From: Peter Wiebe Date: Tue, 6 Feb 2024 18:26:26 +0100 Subject: [PATCH] =?UTF-8?q?Commit=2019=20-=20eingabe=20eines=20Buchstaben?= =?UTF-8?q?=20in=20die=20func=20Hauptspiel=20soll=20erm=C3=B6glicht=20werd?= =?UTF-8?q?en?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/hangman.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/c/hangman.c b/src/main/c/hangman.c index 2c6f2ce..4df1645 100644 --- a/src/main/c/hangman.c +++ b/src/main/c/hangman.c @@ -15,6 +15,7 @@ void levelauswahl(); void hauptSpiel(int level); void draw_hangman(int attempts); void add_guessed_letter(char* guessed_letters, char guessed_letter); +char eingabe_buchstabe(); void protokoll(){ clear_screen(); @@ -259,4 +260,11 @@ void add_guessed_letter(char* guessed_letters, char guessed_letter){ } guessed_letters[strlen(guessed_letters)] = guessed_letter; guessed_letters[strlen(guessed_letters) + 1] = '\0'; +} + +char eingabe_buchstabe(){ + char guess; + scanf(" %c", &guess); + guess = tolower(guess); + return guess; } \ No newline at end of file