diff --git a/src/main/c/Tim/hangman.c b/src/main/c/Tim/hangman.c index 951e977..d77f46a 100644 --- a/src/main/c/Tim/hangman.c +++ b/src/main/c/Tim/hangman.c @@ -54,6 +54,7 @@ void hangman() scanf(" %c", &userSelection); letterGuessed(userSelection, guessWord, length, displayWord); + changeLetter(userSelection, guessWord, length, displayWord); printf("%s\n", displayWord); } @@ -90,6 +91,37 @@ bool wordGuessed(char x[], char y[]) bool letterGuessed(char x, char y[], int length, char ptr[]) { int counter = 0; + for(int i = 0; i0) + { + return true; + } + else + { + return false; + } + +} + + +void changeLetter(char x, char y[], int length, char ptr[]) +{ for(int i = 0; i0) - { - return true; } - else - { - return false; - } - } \ No newline at end of file diff --git a/src/main/c/Tim/hangman.h b/src/main/c/Tim/hangman.h index 9819b9a..ae68d97 100644 --- a/src/main/c/Tim/hangman.h +++ b/src/main/c/Tim/hangman.h @@ -6,5 +6,6 @@ void hangman(); char* getWordFromList(int); bool wordGuessed(char[],char[]); bool letterGuessed(char, char[], int, char[]); +void changeLetter(char, char[], int, char[]); #endif