Next: Play Strategy Up: Parent-Child Protocol Previous: Protocol---Parent Side

Protocol---Child Side

Each of the seven child processes speaks the converse of the parent side of the protocol. All reads are made from the standard input stream and all sends are done to the standard output stream. The only exceptions are fatal error messages, which go to the standard error stream. The details of this protocol are as follows:

  1. Read an indicator of who's going first.
  2. If the first character of that message is `n' or `N', read a message containing the opponent's first move.
  3. Read a message containing a suggested move for evaluation.
  4. Send a message containing the integer evaluation value for that move.
  5. Read a message containing the move selected for the computer.
  6. Read a message indicating whether or not to continue.
  7. If the first character of that message is `n', then exit.
  8. Otherwise, read a message containing the opponent's next move.
  9. Go to step 3.

Each child maintains a copy of the current board on which it bases its evaluation of the suggested move.



Brian L. Stuart