Codebreaker – the solution
The Codebreaker solution is a traditional game to solve a set of colors. With one game type, the player needs to place four colors (which can be duplicates) from a list of six different colors. The correct colors are chosen randomly by the game service. With every move the player makes, an answer is returned: for every color that is correct and positioned at the correct place, a black peg is returned. For every color that is correct but wrongly positioned, a white peg is returned. The player now has up to 12 moves to find the correct solution. Figure 1.4 shows a game run using a Blazor client application.
Figure 1.4 – Blazor client application
This gameplay shows that the solution was found after five moves. In this case, the correct result was yellow – black – red – black. The first selection was red – green – blue – yellow, with a result of two white pegs. With the fifth...