|
|
@ -4,7 +4,10 @@ |
|
|
|
#include <stdlib.h> |
|
|
|
#include <time.h> |
|
|
|
|
|
|
|
char wordlist[10][30] = { |
|
|
|
#define LISTSIZE 10 |
|
|
|
#define MAX_WORD_LENGTH 30 |
|
|
|
|
|
|
|
char wordlist[LISTSIZE][MAX_WORD_LENGTH] = { |
|
|
|
"Kartoffel", "Zigarette", "Haus", "Fenster", "Kartenleseettiketiergeraet", |
|
|
|
"Kleiderschrank", "Schnee","Wasserhahn", |
|
|
|
"Fernbedienung", "Computertastatur" |
|
|
@ -22,10 +25,10 @@ void hangman() |
|
|
|
|
|
|
|
do |
|
|
|
{ |
|
|
|
char guessWord[30]; |
|
|
|
char displayWord[30]; |
|
|
|
char guessWord[MAX_WORD_LENGTH]; |
|
|
|
char displayWord[MAX_WORD_LENGTH]; |
|
|
|
int length; |
|
|
|
strcpy(guessWord,wordlist[rand() % 10]); |
|
|
|
strcpy(guessWord,wordlist[rand() % LISTSIZE]); |
|
|
|
length = strlen(guessWord); |
|
|
|
printf("%s %d\n",guessWord, length); |
|
|
|
for (int i = 0; i <= length; i++) |
|
|
|