Procedural Programming Wrap Up Project
Save a new Java Main Class as MethodsWrapUp_MasterMindV1
Your goal is to create a simplified version of the MasterMind Board game that has been around for decades. If you have not played MasterMind, take 5 minutes to try the online version before continuing:
http://www.kidsmathgamesonline.com/logic/mastermind.html
In our version of the game, the computer thinks of a number consisting of three digits. The other player repeatedly guesses the number and receives the following evaluation of the guess from the opponent:
The code words green, yellow and red will be used to evaluate a guess.
green - A guess is exactly correct (it is the right number in the right position). However, it does NOT indicate which of the three numbers are correct
yellow - A number is guessed correctly but it is in the wrong position
red - the number does not appear anywhere in the solution
Additional Rules:
For example, assume that the number is 123, here are some sample guesses and evaluations.
Guess Evaluation Attempts
134 green, yellow 1 //notice no red
213 green, yellow, yellow 2 //notice the green is first, always
312 yellow, yellow, yellow 3
143 green, green 4
300 yellow 5
555 red 6 //red will only appear here
114 green 7 //notice that there is no
yellow for the second 1
123 green,green,green 7
So as not to provide too many clues, the evaluator always displays the greens before the yellows in the output. Write a program that plays this game with the user. The results should be displayed in the format shown above.
Your program must include at least 3 methods written by you.
The following methods have been used by students in the past but you are certainly welcome to use different ones.
Simpler vs Challenge Version
This assignment will be tricky regardless of what version you pick. However there is a way to challenge yourself even further:
Marking Scheme
40% - Methods used but only solves for green or yellow with errors.
60% - Methods used but only solves for Green or for Yellow. Does so with consistently with no logic errors.
80% - Can properly identify the colors of each guess using a variety of methods (including parameters and return values).
+ 10% - Always prints green first, then yellow. It only prints red when all three are wrong
+ 10% - Handles repeat numbers properly. Each digit guessed should only result in 1 color. See below:
Computer number is 242
Guess is 213
Correct evaluation: Green Incorrect Evaluation: Green Yellow
Computer number is 242
Guess is 443
Correct evaluation: Green Incorrect Evaluation: Green Yellow
Evaluation
Ignore this marking scheme, will be updated shortly for 2019
100%
90%
80%
Computer number is 242
Guess is 213
Correct evaluation: Green Incorrect Evaluation: Green Yellow
Computer number is 242
Guess is 443
Correct evaluation: Green Incorrect Evaluation: Green Yellow
<80%