Question: (1)Write a program (in Python v.2) that is able to pick a random word from a list of words contained in a file and lets

(1)Write a program (in Python v.2) that is able to pick a random word from a list of words contained in a file and lets the user who is interacting with the game guess it one character at a time.

Upon startup, the player must be prompted for their name.

While playing, the player may guess at most 9 incorrect times. If the player guesses a character that has already been tried, he or she must NOT be penalized for doing so (i.e., it will not count as a turn).

The game ends when the full word has been guessed (player wins) or when nine incorrect guesses have been made.

Upon completion of the game, the player's name, the number of turns played, the word that should have been guessed, and an indicator for win/lose must be added to a file.

Make sure to document your code appropriately.

File Format Specification

The file format is as follows:

- The first non-comment line of the file will contain only a number. That number represents the number of usable words in the file.

- Each word will be on a line by itself. Words may contain only letters (a-z)

- Lines starting with a semicolon (;) or with a hashmark (#) are comments and must be ignored.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!