There are five deliverables from this exercise. The new classes will require complete Javadoc comments or Python docstrings.
A revision to the Player to add the
following method. The superclass version doesn't do anything with
this information. Some subclasses, however, will process
this.
void winners(Bin outcomes);The SevenReds subclass of
Player.
A revision to the Game class. This
will call the winners with the winning
Bin instance before paying off the
bets.
A unit test of the SevenReds class.
This test should synthesize a fixed list of
Outcomes, Bins, and
calls a SevenReds instance with various
sequences of reds and blacks. One test cases can assure that no
bet is placed until 7 reds have been seen. Another test case can
assure that the bets double (following the Martingale betting
strategy) on each loss.
A main application class that creates the necessary objects,
runs the Simulator's
gather method, and writes the available
outputs to System.out In this case, it will
simply print the list of maxima, and the list of session
lengths.