8.3.0.10

9 — Help!

Due Wednesday, 24 November 2021, 11:59:59pm

The purpose of this milestone is to make sure that the logical parts of your code base pass some basic integration tests. It should reduce the likelihood of logical bugs when you need to debug the server-client architecture of 10 — This is it!, meaning you can concentrate on the new code.

I also urge you to make a plan for the communication layer: a todo list of modules/classes to create, including a precise purpose statement and a description of its functionality/ties.

Delivery No deliverables are expected. The purpose of the milestone is to set a pace for the development of the final product (10 — This is it!) and to help you evaluate your progress.

I will post some test cases on the front page for the specified test harness so that you can eliminate bugs from logic components before you run integration tests on the full system (incl. the communication layer).

Misbehaving Players As the testing task of 8 — The League already specified, the manager must notice bad behavior on the side of players. When a manager notices misbehavior, the corresponding player is eliminated without ado and moved to the bunch of “cheating” players.

Testing Task Create a test harness named xmanager The harness consumes its JSON input from STDIN and prints its results to STDOUT. Create three tests; place them in Tests/.

Constraint No test file may exceed the size limit of 20Kb.

Its inputs are the same kind of three JSON values as those provided to xref from 8 — The League. The three values specify the game map to be used for a tournament, the participating players (in descending order of age), and which colored cards to hand out and in which order the tournament referees hand them out. — All players submit the specified Map in response to the manager’s launch of the tournament, making all games and hence the tournament deterministic. Each referee determines the destinations and hands them out in the lexicographic order specified in 5 — The Strategy.

The output is either the JSON string "error: not enough destinations" or the outcome of running the tournament. The manager should not run any games if the chosen map doesn't support running all games. The latter consists of a JSON array that contains two Ranks: the first contains the names of the winner(s) and the second contains the names of the misbehaving players.

As always, the tests are well-formed and valid JSON.