CS 0447 – Project 1: Lingo

Due: Sunday, June 26, 2016, by 11:59pm

Description

Your first project is to implement the game of Lingo. In this game, the computer chooses a random 5-letter word.  The player’s job is then to guess the word that the computer has chosen. After each guess by the player, the computer will give feedback:

1.       The first is which letters are in the proper position.

2.       The second is which letters are not in the proper position.

The player wins when they guess the exact word the computer chose. The player must guess correctly in 5 or fewer guesses, otherwise the player loses.

What you need to do:

·         Choose a random 5-letter word from a list of 10 such words declared in the .data section. Output the first letter and 4 blanks (underscores separated by spaces).

·         Read a guess from the user as a string (see example below). Assume the input is lowercase.

·         Convert each letter to uppercase in the output (see example below).

·         For each letter that is correct, report if it is in the proper position or not.

·         Allow the user to continue to guess until they get it correct, or reach 5 turns and they lose.

·         Allow the user to play the game multiple times.

Example:

Welcome to Lingo!

 

The word to guess is: C _ _ _ _

 

Enter guess number 1: chair

 

C is in the right place

H is in the word but not the right place

 

Enter guess number 2: couch

 

You win!

Would you like to play again? yes

Hints:

Submission

Create a zip file of your source code and a README.txt text file that has your name, your Pitt username and any notes for the TA to help with grading.

Name the file USERNAME-project1.zip

Use the lab submission policies to upload your project.