''' * Program or Lab #: Insert assignment name * * Programmer: Insert your name * * Due Date: November 16, 2017 * * COMP141, Fall 2017 * * Pledge: I have neither given nor received unauthorized aid * on this program. * * Description: Insert a brief paragraph describing the program * * Input: Insert a brief description of user inputs, or "None" if * there is no user input * * Output: Insert a brief description of the program output * ''' # This function counts the number of perfect matches between the guess and the code # A perfect match is when a digit in guess is in the exact same position in code # Parameters: code, a 4-digit string, guess, a 4-digit string # Returns: the number of perfect matches between guess and code def count_perfect_matches(code, guess): return # REMOVE THIS LINE WHEN YOU BEGIN CODING # This function counts the number of near matches between the guess and the code # A near match is when a digit in guess is in code, but in a different position # Parameters: code, a 4-digit string, guess, a 4-digit string # Returns: the number of near matches between guess and code def count_near_matches(code, guess): return # REMOVE THIS LINE WHEN YOU BEGIN CODING # This function determines if the passed in string has any characters repeated in it # Parameters: guess, a string # Returns: True if any characters are repeated, False otherwise def repeated(guess): return # REMOVE THIS LINE WHEN YOU BEGIN CODING def main(): # Here is pseudocode to help you: # Ask the user to enter a 4-digit secret code. # Make an integer variable to store the number of guesses # Prompt the user for their first guess # Use input validation to make sure they entered a valid guess # If the guess is valid, add one to number of guesses # Keep looping until either the user guesses the correct code or # they've used up all 12 of their guesses # Tell the user how many perfect matches they had in their guess # Tell the user how many near matches they had in their guess # Prompt the user to guess # Use input validation to make sure they entered a valid guess # If the guess is valid, add one to number of guesses #When the game is over, tell the player if they won or lost #If they lost, be sure to tell them what the secret code was main()