From 073381aed8ffa31f13178d5f4b1cc9481d265665 Mon Sep 17 00:00:00 2001 From: Peter Wiebe Date: Tue, 6 Feb 2024 18:23:00 +0100 Subject: [PATCH] =?UTF-8?q?Commit=2016=20-=20func=20hangman=20soll=20gezei?= =?UTF-8?q?chnet=20werden=20k=C3=B6nnen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/hangman.c | 75 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/src/main/c/hangman.c b/src/main/c/hangman.c index bada2bb..04fcdd1 100644 --- a/src/main/c/hangman.c +++ b/src/main/c/hangman.c @@ -13,6 +13,7 @@ void startauswahl(); void nameAusgeben(); void levelauswahl(); void hauptSpiel(int level); +void draw_hangman(int attempts); void protokoll(){ clear_screen(); @@ -173,4 +174,78 @@ void hauptSpiel(int level){ //Buchstaben sollen gezeigt werden //Buchstaben sollen eingegeben werden können //eingegeben Buchstaben sollen überprüft und dem Lösungswort hinzugefügt werden, damit Gewinn ermittelt werden kann +} + +void draw_hangman(int attempts) { + clear_screen(); + printf("Galgenmann!\n"); + printf("v.1.0.2\n\n"); + + switch(attempts) { + case 0: + printf(" _______\n"); + printf(" | |\n"); + printf(" |\n"); + printf(" |\n"); + printf(" |\n"); + printf(" |\n"); + printf("__|_________\n\n\n\n"); + break; + case 1: + printf(" _______\n"); + printf(" | |\n"); + printf(" | O\n"); + printf(" |\n"); + printf(" |\n"); + printf(" |\n"); + printf("__|_________\n\n\n\n"); + break; + case 2: + printf(" _______\n"); + printf(" | |\n"); + printf(" | O\n"); + printf(" | |\n"); + printf(" |\n"); + printf(" |\n"); + printf("__|_________\n\n\n\n"); + break; + case 3: + printf(" _______\n"); + printf(" | |\n"); + printf(" | O\n"); + printf(" | /|\n"); + printf(" |\n"); + printf(" |\n"); + printf("__|_________\n\n\n\n"); + break; + case 4: + printf(" _______\n"); + printf(" | |\n"); + printf(" | O\n"); + printf(" | /|\\\n"); + printf(" |\n"); + printf(" |\n"); + printf("__|_________\n\n\n\n"); + break; + case 5: + printf(" _______\n"); + printf(" | |\n"); + printf(" | O\n"); + printf(" | /|\\\n"); + printf(" | /\n"); + printf(" |\n"); + printf("__|_________\n\n\n\n"); + break; + case 6: + printf(" _______\n"); + printf(" | |\n"); + printf(" | O\n"); + printf(" | /|\\\n"); + printf(" | / \\\n"); + printf(" |\n"); + printf("__|_________\n\n\n\n"); + break; + default: + break; + } } \ No newline at end of file