I was wondering if anyone could give me some help with this problem?! Its been killing me!!!

The Numbers Game is played as follows:

1. Person A selects three numbers, for example, (1 2 3).

2. The goal of the game is for Person B to guess the numbers Person A has selected in the correct order.

3. For example, if Person B guesses (7 3 1), then Person A answers (2 0).

a. The 2 means Person B correctly guessed two numbers (digits) selected by Person A. The 0 means no digit was in its correct position.

4. If Person B guesses (1 4 3), then Person A answers (2, 2).

a. The first 2 means Person B correctly guessed two numbers selected by Person A. The second 2 means both of the numbers were in their correct positions.

5. If Person B guesses (6 0 8), then Person A answers (0, 0).

6. If Person B guesses (3 1 2), then Person A answers (3, 0).

7. If Person B guesses (1 3 2), then Person A answers (3, 1).

8. If Person B guesses (1 2 3), then Person A answers, Bravo!!!! (1 2 3) you got it!!!

Required:

Write a program called NumbersGame.py that simulates this game with the Computer playing the role of Person A and you playing the role of Person B. Please note that the user guess is read as a single string containing three digits. For example, the string (1 2 3) or (4 7 0). In Python, a random number may be generated by importing the random module and using either the randint or randrange function. For example, x = random.randrange(min, max). The program should be played using the digits 0 to 9, and should display the following message at the start of the game:

Welcome to the Numbers Game

===========================

I have three digits.

Try to guess the digits in the order in which I listed them

For example, if you entered (1 2 3) and my answer was (1 2 3),

Then, bravo! You would be correct!

However, if you entered (1 2 4), my response would be (2, 2).

The first 2 means you have two of my three numbers.

The second 2 means you have both numbers in their correct positions.

So if you had enter (3 4 1) my answer would be (2, 0) and

If you had entered (5 7 0) my answer would be (0, 0).

The program should use the following functions:

1. def printOpeningMessage() prints the opening message.

2. def getThreeDigits() inputs and return three distinct digits.

3. def getUserGuess() inputs the user guess, extract and return the three digits from the guess.

4. def printOpeningMessage() prints the opening message.

5. def getCounts(secret1, secret2, secret3, guess1, guess2, guess3) returns the number of correct digits and the number of digits in correct positions.

6. def printWinningMessage() prints the winning message.

The program should implement the following main-program algorithm:

1. Print the opening message

2. Input the three distinct integers

3. Set the counters for number of correct digits and number of digits in correct position to zero.

4. Repeat the following steps as long as the guess is incorrect

A. Get guess from user (extract and return 3 digits)

B. Get count of number of correct digits and number of digits in correct positions.

C. If the guess is incorrect then: format and print the clue, and reset the number of correct digits and number of digits in correct position to zero.

5. Print the winning message.

Tweet This+ 1 thisPost To Linkedin