Yeah no problem, ill paste the whole assignment.
Mastermind is a logic game for two players. In each round, one player plays the part
of codemaker, and the other plays codebreaker. The codemaker secretly creates a
sequence of four (4) colored pegs, selected from among six (6) different colors. In
our case we will not use duplicate colors. The codebreaker then creates guesses in
the same way, and receives feedback regarding each guess. The feedback consists
of two numbers. The first number specifies how many pegs in the guess are both
the correct color and position. The other number represents correct colors that are
in the wrong position. Using this feedback and comparing the results of several
guesses, the codebreaker should be able to deduce the codemaker’s actual
sequence. (See the examples to help clarify the rules.)
Ryan enjoys the game, but he sometimes suspects that the codemaker may be
cheating by giving false feedback. In fact, it sometimes seems that there is no
possible sequence consistent with all of the feedback he has received. But Ryan
doesn’t want to go to the trouble of proving this himself, and he has asked you to
write a program to find out.
You will be given a set of guesses with their corresponding feedback, and your task
is to answer whether there is any possible sequence that is consistent with all the
The input will begin with a single integer N, which will be followed by N lines, each
describing a guess and its feedback in the following format:
XXXX A B
where XXXX are four uppercase characters identifying the colors in the guess, A is
the number of correct pegs in the guess, and B is the number of pegs of correct
color but incorrect position. The list of possible colors is Red, Green, Blue, Yellow,
Orange, White, each identified in the input by its first letter.
Your output should be either “Valid Feedback” or “Invalid Feedback”, depending
on whether any possible sequence of colors could have produced the given
feedback for all the guesses.
BYOG 3 0
BGOY 3 0
GROW 2 1
BROW 1 2
GOBW 4 0