Пример #1
0
/* Function:  Play a stone of the given color at the given vertex.
 * Arguments: color, vertex
 * Fails:     invalid vertex, illegal move
 * Returns:   nothing
 *
 * Status:    GTP version 2 standard command.
 */
static int gtp_play(char *s) {
  DataGo move;

  if (!gtp_decode_move(s, &move))
    return gtp_failure("invalid color or coordinate");

  if (!game->play_move(move))
    return gtp_failure("illegal move");

  return gtp_success("");
}
Пример #2
0
static int
gtp_play(char *s)
{
  int i, j;
  int color = EMPTY;

  if (!gtp_decode_move(s, &color, &i, &j))
    return gtp_failure("invalid color or coordinate");

  if (!legal_move(i, j, color))
    return gtp_failure("illegal move");

  play_move(i, j, color);
  return gtp_success("");
}