|
@ -16,6 +16,58 @@ char wordlist[LISTSIZE][MAX_WORD_LENGTH] = { |
|
|
"Fernbedienung", "Computertastatur" |
|
|
"Fernbedienung", "Computertastatur" |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
char hangmanStages[7][100]={ |
|
|
|
|
|
"+---+\n" |
|
|
|
|
|
"| |\n" |
|
|
|
|
|
"|\n" |
|
|
|
|
|
"|\n" |
|
|
|
|
|
"|\n" |
|
|
|
|
|
"|\n" |
|
|
|
|
|
"=========\n", |
|
|
|
|
|
"+---+\n" |
|
|
|
|
|
"| |\n" |
|
|
|
|
|
"| O\n" |
|
|
|
|
|
"|\n" |
|
|
|
|
|
"|\n" |
|
|
|
|
|
"|\n" |
|
|
|
|
|
"=========\n", |
|
|
|
|
|
"+---+\n" |
|
|
|
|
|
"| |\n" |
|
|
|
|
|
"| O\n" |
|
|
|
|
|
"| |\n" |
|
|
|
|
|
"|\n" |
|
|
|
|
|
"|\n" |
|
|
|
|
|
"=========\n", |
|
|
|
|
|
"+---+\n" |
|
|
|
|
|
"| |\n" |
|
|
|
|
|
"| O\n" |
|
|
|
|
|
"| /|\n" |
|
|
|
|
|
"|\n" |
|
|
|
|
|
"|\n" |
|
|
|
|
|
"=========\n", |
|
|
|
|
|
"+---+\n" |
|
|
|
|
|
"| |\n" |
|
|
|
|
|
"| O\n" |
|
|
|
|
|
"| /|\\\n" |
|
|
|
|
|
"|\n" |
|
|
|
|
|
"|\n" |
|
|
|
|
|
"=========\n", |
|
|
|
|
|
"+---+\n" |
|
|
|
|
|
"| |\n" |
|
|
|
|
|
"| O\n" |
|
|
|
|
|
"| /|\\\n" |
|
|
|
|
|
"| /\n" |
|
|
|
|
|
"|\n" |
|
|
|
|
|
"=========\n", |
|
|
|
|
|
"+---+\n" |
|
|
|
|
|
"| |\n" |
|
|
|
|
|
"| O\n" |
|
|
|
|
|
"| /|\\\n" |
|
|
|
|
|
"| / \\\n" |
|
|
|
|
|
"|\n" |
|
|
|
|
|
"=========\n", |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void hangman() |
|
|
void hangman() |
|
|
{ |
|
|
{ |
|
@ -57,7 +109,10 @@ void hangman() |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
letterGuessed(userSelection, guessWord, length, displayWord); |
|
|
|
|
|
|
|
|
if(!letterGuessed(userSelection, guessWord, length, displayWord)) |
|
|
|
|
|
{ |
|
|
|
|
|
drawHangman(); |
|
|
|
|
|
} |
|
|
changeLetter(userSelection, guessWord, length, displayWord); |
|
|
changeLetter(userSelection, guessWord, length, displayWord); |
|
|
printf("%s\n", displayWord); |
|
|
printf("%s\n", displayWord); |
|
|
} |
|
|
} |
|
@ -156,4 +211,10 @@ void changeLetter(char x, char y[], int length, char ptr[]) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void drawHangman() |
|
|
|
|
|
{ |
|
|
|
|
|
for(int i = 0; i<7;i++) |
|
|
|
|
|
printf("%s", hangmanStages[i]); |
|
|
} |
|
|
} |