Purchase Solution

using C designing a simple letter guessing game

Not what you're looking for?

Ask Custom Question

Using only C (not c++) design the program described

General Requirements
? Write a program that reads letters from a file called"inputLet.txt".
? Your program will ask the user to enter the number of games they wish to play (1 to 4)
? This program should open an inputLet.txt file , read in one character at a time and repeat this for the number of games the user wants to play.
? the test file will contain at least 15 letters, all lowercase
? When the number of games has been played, the program will end

? A preprocessor directive must be used to define the maximum number of guesses as 5
? If the player has used up all of their guesses, a message that the game is over should be displayed along with the letter they were trying to guess.
? You must have at least 4 user defined functions as follows:

//this function provides instructions to the user on how to play the game
void Instructions( );

//this function runs one game. It for checks either 5 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 PlayGuess(char solution);

//this function prompts the player to make a guess and returns that guess
//this function is called from inside the PlayGuess( ) function described above
char GetLetter( );

//this function takes two arguments, the guess from the player
//and the solution letter 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 solution and returns a 0 if they do not match
int CompareLetters(char guess, char solution);

Additional Requirements:
? Use function prototypes.
? Write comments for each function that will appear in the file before each prototype and again before each function definition.
? Be sure to comment your code adequately.
? Be sure to indent properly.
? Use meaningful variable names

Purchase this Solution

Solution Summary

The expert examines using C designing a simple letter guessing game.

Purchase this Solution


Free BrainMass Quizzes
Javscript Basics

Quiz on basics of javascript programming language.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Basic Networking Questions

This quiz consists of some basic networking questions.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

C# variables and classes

This quiz contains questions about C# classes and variables.