Is a code-breaking game. More info in Wikipedia
This is my personal project to study clean code, TDD and other software engineering best practices as SOLID principles.
It is based on the exercise proposed by Uncle Bob's screen cast in Episode 9, Single Responsability Principle
A Code is defined by disposed order of pegs, where each peg can have a different color (state). The default configuration is 4 pegs and 6 colors.
A Code can be compared to each other and it gives a Score for this comparison
A [Score] represents how many pegs are in the same position for both codes. And how many pegs are in both codes but in diferent positions
Where '+' represents a peg in the same position, and '-' a peg in both codes but diferent positions:
- If the secret code is "AABB" and the guess is "BBAE", the score is "---".
- If the secret code is "ABCD" and the guess is "ACDB", the score is "+---".
More examples should be easly readable in Code spec file
A SecretCodeHolder is responsible for holding a code and answering scores to the guesser.
The CodeBreaker is responsible for breaking the code.
It starts with a guess, then receive a score for this current guess and makes a new guess.