8.7

6 — Games!

Due Thursday, 15 December 2020, 09:59:59pm

Delivery Place the product of this week’s project steps into your repo as follows:

Since Python’s naming system is badly designed and its convention interfere with the specified name, Pythonistas may substitute _ for - in these file names.

  • for the Programming Task, place
    • player.PP in the Player/ directory

    • referee.PP in a new Admin/ directory in Fish/

  • for the Design Task, place
    • manager-interface.PP in Admin/

    • manager-protocol.md in Planning/

  • for the Testing Task, place xstrategy and Tests/ in a repo-level directory named 6

You may create Other/ directories in both 6 and Fish.

Programming Task Co-design implementations for the following components:

You are free to modify your designs in Planning/ according to any insights you may have. But, running a game does not involve any remote interactions. We are still working on the logic of the software.

Testing Task Create a test harness named xstrategy The harness consumes its JSON input from STDIN and produces its results to STDOUT. Create five tests and place them in Tests.

The tests are formulated as pairs of files: <n>-in.json, the input, and <n>-out.json, the expected result, for an integer <n> greater or equal to 1.

Its inputs are arrays with two fields:

    Depth-State is [D, State]

     where D (short for depth) is a Natural in [1,2]

Well-formed and Valid You may assume that all inputs for your test harnesses will be well-formed JSON and valid according to the homework description. You may also assume that the state is legal; furthermore, the given state describes a situation after players have placed all penguins and are ready to take turns. A valid State also comes with at least two players, each of which has the appropriate number of penguins on the board.

Its expected output is the best turn Action for the given depth D (above) and State that the next (first in array) player can take according to the strategy.PP component from 5 — The Strategy. As before false is used to signal that there is no feasible Action.