Esempio n. 1
0
GTPResponse GTP::gtp_patterns(vecstr args) {
    bool symmetric = true;
    bool invert = true;
    std::string ret;
    const Board & board = *hist;
    for(Board::MoveIterator move = board.moveit(); !move.done(); ++move) {
        ret += move->to_s() + " ";
        unsigned int p = board.pattern(*move);
        if(symmetric)
            p = board.pattern_symmetry(p);
        if(invert && board.toplay() == Side::P2)
            p = board.pattern_invert(p);
        ret += to_str(p);
        ret += "\n";
    }
    return GTPResponse(true, ret);
}
Esempio n. 2
0
GTPResponse HavannahGTP::gtp_patterns(vecstr args){
	bool symmetric = true;
	bool invert = true;
	string ret;
	Board board = game.getboard();
	for(Board::MoveIterator move = board.moveit(); !move.done(); ++move){
		ret += move->to_s() + " ";
		unsigned int p = board.pattern(*move);
		if(symmetric)
			p = board.pattern_symmetry(p);
		if(invert && board.toplay() == 2)
			p = board.pattern_invert(p);
		ret += to_str(p);
		ret += "\n";
	}
	return GTPResponse(true, ret);
}
Esempio n. 3
0
GTPResponse GTP::gtp_all_legal(vecstr args) {
    std::string ret;
    for(Board::MoveIterator move = hist->moveit(); !move.done(); ++move)
        ret += move->to_s() + " ";
    return GTPResponse(true, ret);
}