akosiraff

Download LetterGuessingGame_C

Sep 27th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/letterguessinggame_c/
  3. You will write a C program that will play a letter guessing game.
  4. General Requirements
  5. ? Write a program that reads letters from a file called β€œlettersin.txt”.
  6. ? Your program will ask the user to enter the number of games they wish to play (1 to 4)
  7. ? Your program will open the lettersin.txt file read in one character at a time and repeat this for the
  8. number of games the user wants to play.
  9. ? For this assignment the test file will contain letters, all lowercase
  10. ? When the number of games has been played, the program will end
  11. ? A sample of an input file that you can use to test your program is included with the assignment.
  12. ? A preprocessor directive must be used to define the maximum number of guesses as 5
  13. ? If the player has used up all of their guesses, a message that the game is over should be displayed
  14. along with the letter they were trying to guess.
  15. ? You must have at least 4 user defined functions as follows:
  16. //this function provides instructions to the user on how to play the game
  17. void GameRules( );
  18. //this function runs one entire game. It for checks either 5 incorrect guesses or a correct guess.
  19. //It returns a 0 if the game is over and the player did not guess the letter, otherwise it returns 1.
  20. int SingleGame(char file_letter);
  21. //this function prompts the player to make a guess and returns that guess
  22. //this function is called from inside the SingleGame( ) function described above
  23. char RetrieveGuess( );
  24. //this function takes two arguments, the guess from the player
  25. //and the solution letter from the file.
  26. //It lets the user know if the guess comes alphabetically before or after the answer
  27. //The function returns 1 if the guess matches the solution and returns a 0 if they do not match
  28. //this function is called from inside the OneGame( ) function described above
  29. int GuessedIt(char answer, char input_letter);
  30. Additional Requirements:
  31. ? Use function prototypes.
  32. ? Write comments for each function that will appear in the file before each prototype and
  33. again before each function definition.
  34. ? Be sure to comment your code adequately.
  35. ? Be sure to indent properly. Check your textbook and lecture code examples to see how it should
  36. be done.
  37. ? Use meaningful variable names
  38. ? Check all requirements list on Blackboard before submitting
  39. Download: http://solutionzip.com/downloads/letterguessinggame_c/
Add Comment
Please, Sign In to add comment