|
|
@ -3,6 +3,7 @@ |
|
|
|
#include <string.h> |
|
|
|
#include <stdlib.h> |
|
|
|
#include <time.h> |
|
|
|
#include <stdbool.h> |
|
|
|
|
|
|
|
#define LISTSIZE 10 |
|
|
|
#define MAX_WORD_LENGTH 30 |
|
|
@ -46,9 +47,13 @@ void hangman() |
|
|
|
} |
|
|
|
printf("%s\n", displayWord); |
|
|
|
|
|
|
|
printf("Bitte gib einen Buchstaben ein!\n"); |
|
|
|
scanf(" %c", &userSelection); |
|
|
|
printf("%c\n", userSelection); |
|
|
|
while(!wordGuessed(guessWord, displayWord)) |
|
|
|
{ |
|
|
|
printf("Bitte gib einen Buchstaben ein!\n"); |
|
|
|
scanf(" %c", &userSelection); |
|
|
|
printf("%c\n", userSelection); |
|
|
|
} |
|
|
|
|
|
|
|
}while(userSelection != '0'); |
|
|
|
} |
|
|
|
|
|
|
@ -65,3 +70,14 @@ char* getWordFromList(int x) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
bool wordGuessed(char x[], char y[]) |
|
|
|
{ |
|
|
|
if(strcmp(x,y) == 0) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |