I need help figuring out how to make it so that when you guess, it let's you know you are wrong and tells if the right letter comes before or after the letter you guess. And if you are right it tells you that.
Also if you find any inconsistencies in my code so far tell me.
#define MAXGUESSES 6
void Instructions( );
int PlayGame(char answer);
char GetGuess( );
int CompareGuess(char guess, char answer);
//declare additional variables
int gamesToPlay = 0;
int i = 0;
//get c letter
//get number of games to play
//get a letter from file
//Play one game
//check for win or lose
//this function provides instructions to the user on how to play the game
void Instructions( )
printf("Welcome to Letter Guess\n");
printf("To begin you will enter the number of games you want to play(1 – 5 games)\n");
printf("You have 6 chances to guess each letter\n");
printf("Let's begin:\n\nHow many games would you like to play? (1 - 5):");
//this function prompts the player to make a guess and returns that guess
//this function is called from inside the PlayGame( ) function described above
char GetGuess( )
printf("Enter a guess:", guess);
//this function takes two arguments, the guess from the player and the answer from the file.
//It lets the user know if the guess comes alphabetically before or after the answer
//The function returns 1 if the guess matches the answer and returns a 0 if they do not match
int CompareGuess(char guess, char answer)
if (guess > answer)value=0;
printf("letter come before");
//this function runs one game. It for checks either 6 incorrect guesses or correct guess.
//It returns a 0 if the game is over and the player did not guess the letter, otherwise it returns 1.
int PlayGame(char answer)
int numGuesses = 0;
while(numGuesses < MAXGUESSES)
//get guess function call
//compare guess function call
//update counter for number of guesses used
numGuesses = numGuesses +1;