We will spend some time looking around at the completed code for the Mastermind game. Recall the diagram describing the structure of the code.
MasterMind
folder in it, so you don’t need to create any special folders.MasterMind
folder that you just extracted.test
directory and choosing “Run all tests”, make sure your tests pass.Game
class’ main
method in the src
directory, and play the game once, to make sure it all works.Are the classes and interfaces separated in modules according to the diagram?
Identify which parts/lines of the code establish each of the arrows we have in the diagram, namely:
Game
to GameConsole
Game
to GameEngine
GameConsole
to Console
GameEngine
to Console
GameEngine
to Guesser
Guesser
to GuessChecker
RememberingGuessChecker
to GuessChecker
RememberingGuessChecker
to Scorer
What are the methods specified in the Console
interface? What method is missing from there that we would have expected?
What are the private methods of the GameConsole
class, and what do they do?
How are the console
and guessChecker
provided to the GameEngine
class?
If we want to move the GameConsole
class to the upper level, what prevents us from doing that? How can we fix it?
What are the methods specified in the GuessChecker
interface? What do they do? Are their names appropriate?
How does the RememberingGuessChecker
implement the methods in the GuessChecker
interface?
When are new instances of the Scorer
class created?
If we want to change the set of letters that the game is based on, which files would that affect?
How is the Guesser
generating new guesses?
The Score
and ScoreRecord
classes are not in our diagram yet.