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