### Cootie Player

OVERVIEW

The children's game of Cootie is played with pencil, paper, and a six sided die. Two players compete to be the first to draw a complete "cootie" which must have a body, a head, two eyes, two antennae, six legs, and a tail:

! !

(o o)

- [ ] -

- [ ] -

- [ ] -

T

Each person in turn rolls the die, and depending on the roll, gets to add a body part to their drawing. 1 means the body may be drawn (brackets), 2 means the head may be drawn (parentheses), 3 means a leg may be drawn (dash), 4 means an antenna may be drawn (exclamation point), 5 means an eye may be drawn (letter o), and 6 means the tail may be drawn (letter T). The body must be drawn first; the head must be drawn before eyes or antennae. Whichever player completes their drawing first is the winner.

We want a computer Cootie player that can draw its own cootie according to the rules of the game. The human player must roll the die and enter the value to the computer. The computer then determines which part to add (if any) and displays the drawing. The human has to draw his or her own cootie. The computer should be able to detect when it has completed its drawing and display an appropriate message.

1.0 INPUT REQUIREMENTS

1.1 Roll: an integer between 1 and 6, the value of the die roll for the computer's turn.

2.0 OUTPUT REQUIREMENTS

2.1 Prompt for input of roll.
2.2 The Cootie drawing (or partial) using ASCII characters.
2.3 "Can't add a part" message if rules don't allow a move.
2.4 Done message when the drawing is complete.

3.0 FUNCTIONAL REQUIREMENTS

3.2 Display prompt for input of roll.
3.3 Determine if a part can be added to the cootie, depending on the roll:

3.3.1     1 = body
3.3.3     3 = one leg
3.3.4     4 = one antenna
3.3.5     5 = one eye
3.3.6     6 = tail
3.3.7     The body must be drawn before any other part (I.e., until a 1 is rolled, no part may be drawn).
3.3.8     The head must be drawn before eyes or antennae.
3.4 If no part can be added (according to the rules), display a message.
3.5 If a part has been added, display the updated cootie drawing.
3.6 Count how many turns are taken.
3.7 Determine if the drawing is complete, i.e., all the parts have been drawn.
3.8 When the drawing is complete, display a message that tells how many turns were taken to finish the cootie, then terminate.   4.0 ERROR HANDLING
4.1 If the input for the roll is less than 1 or greater than 6, display an error message and allow the user to re-enter the value.

5.0 USER INTERFACE

5.1 The interface will be a simple scrolling text display using ASCII characters for the drawing, as shown above.
5.2 Input prompt: "Input dice roll: "

5.4 Done message:
"Congratulations you have completed your cootie!
It took you __ turns to finish your cootie."

### Objectives

• To demonstrate your mastery of writing programs with iteration and selection control structures.

### Resources

• Your instructor or the designated department tutors in the tutoring center.
• Your own innate capabilities and resourcefulness!
• A working program exhibiting the behavior that your program should exhibit when you finish it that you can run on Unix1 by typing the command
`~graderjd/Public/cooties.exe 		`

#### Ground Rules

• Your program must not use any global variables.  You may declare variables that are local to the main function.
• Your program must mimic the sample program's behavior exactly , letter for letter (see Resources section above on how to run the sample program).
• NOTE: This project is to be an individual effort!   DO NOT collaborate with any of your classmates -- or anyone else on this project.   Violating this rule may result in being failed from the course.

### 2.0 Constraints

The game logic is to be implemented in the main function of a separate driver file named magpiefate.c

### 3.0 Testing

You don't need to create unit tests for this program.  Simply test your program manually by trying all the game conditions as described in the rules.

This assignment is worth 50% of a regular project.

Since this is an extra credit assignment, only submissions that meet all the requirements will receive credit.  Your program will be run with the instructor's automated test suite and programs that don't pass all the tests are unlikely to receive any credit.

Remember, your program will be tested on Unix1.  Code that does not compile will receive a grade of zero.