For this assignment, you are to write a program that plays the game of Hangman. The assignment serves two purposes.
First, it is designed to give you practice with strings, pointers and file I/O. Second, it gives you a chance to write a program
that is larger than those you have written for most previous assignments. Large programs require more up-front organization
than small programs, and it is important that you begin to get experience with larger programs at this point in the course.
Because of the additional organizational work and the fact that there are more details to manage, you are strongly
encourage to work in teams of two for this assignment. For your version, you will use phrases rather than single words for
the user to guess
You must choose a phrase randomly from a dictionary file. Dictionary files will contain some number of lines,
each line contains a phrase, as shown below. The number of words per file may vary, as will the maximum
number of characters in any line. Your program should prompt the user for the name of a dictionary file to use. It
should then open the file, count the number of lines, count the largest number of characters in any single line,
and then randomly select one line to read in. You should dynamically allocate enough space for the randomly
chosen line based on what you know about the size of the largest word in the file. You should create a phrase
file with an end-of-line character at the end of the last line in the file. An input file might look like:
One good turn deserves another
She gets confused flying over the dateline
If I can't dance I don't want to be part of your revolution
A rolling stone gathers no moss
Nothing in all the world is more dangerous than sincere ignorance and conscientious stupidity
hello, Is anybody out there?
ou are NOT ALLOWED to use the book's libraries strlib.h or simpio.h for this assignment. Instead, you must rely
on C's standard set of string-manipulation functions, provided by the string.h library, and C's standard set of input
and output functions, provided by the stdio.h library.
Grading
Part of your grade on this program will be style. To receive an A, your program must have good modular design and good
use of data structures. Also, your code should be efficient and well commented.
Submission