Exemplo n.º 1
0
SgMove GoGtpCommandUtil::MoveArg(const GtpCommand& cmd, std::size_t number,
                                 const GoBoard& board)
{
    if (cmd.ArgToLower(number) == "pass")
        return SG_PASS;
    return PointArg(cmd, number, board);
}
Exemplo n.º 2
0
SgBlackWhite GoGtpCommandUtil::BlackWhiteArg(const GtpCommand& cmd,
                                             std::size_t number)
{
    string value = cmd.ArgToLower(number);
    if (value == "b" || value == "black")
        return SG_BLACK;
    if (value == "w" || value == "white")
        return SG_WHITE;
    throw GtpFailure() << "argument " << (number + 1)
                       << " must be black or white";
}
Exemplo n.º 3
0
//----------------------------------------------------------------------------
SgUctMoveSelect SgGtpUtil::MoveSelectArg(const GtpCommand& cmd, size_t number)
{
    std::string arg = cmd.ArgToLower(number);
    if (arg == "value")
        return SG_UCTMOVESELECT_VALUE;
    if (arg == "count")
        return SG_UCTMOVESELECT_COUNT;
    if (arg == "bound")
        return SG_UCTMOVESELECT_BOUND;
    if (arg == "estimate")
        return SG_UCTMOVESELECT_ESTIMATE;
    throw GtpFailure() << "unknown move select argument \"" << arg << '"';
}