April 2017
Beginner
504 pages
14h 11m
English
We discussed the different Java language elements and JDK classes that are all available to implement parallel algorithms. Now, we will see how to use these approaches to implement the parallel guesser for the Masterrmind game.
The class that performs the creation of the guesses is named IntervalGuesser. It creates the guesses between a start and an end guess and sends them to a BlockingQueue. The class implements Runnable so it can run in a separate Thread. The purist implementation will separate the Runnable functionality from the interval guessing, but as the whole class is hardly more than 50 lines, it is forgivable sin implementing the two functionalities in a single class.
public class IntervalGuesser extends UniqueGuesser ...
Read now
Unlock full access