7.9.0.10

6 — Games!

Due Thursday, 05 November 2020, 11: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.

Design Task The next step is to design the tournament manager component. It interacts with the 1000s of players that signed up for a tournament, How they sign up at the communication layer is not the manager’s problem, because this is definitely going to involve some remote interactions. the referee, and possibly tournament observers.

Design an interfaces for a tournament manager including its protocol. Spell out its purpose and workings so that you can ship off the specification to some third-party software producer and get something useful back.

Two pages should suffice. Less is more.

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 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.