打三棋规则改为: 当前子处于“三连”之中依然可以去子

This commit is contained in:
CalciteM 2019-06-22 11:46:32 +08:00 committed by CalciteM Team
parent 961250d466
commit a161c36b1a
2 changed files with 11 additions and 2 deletions

View File

@ -31,6 +31,7 @@ const struct NineChess::Rule NineChess::RULES[N_RULES] = {
false, // 先摆棋者先行棋
true, // 可以重复成三
false, // 多个“三连”只能提一子
false, // 不能提对手的“三连”子,除非无子可提;
true, // 摆棋满子闷棋只有12子棋才出现算先手负
true, // 走棋阶段不能行动(被“闷”)算负
false, // 剩三子时不可以飞棋
@ -53,6 +54,7 @@ const struct NineChess::Rule NineChess::RULES[N_RULES] = {
true, // 后摆棋者先行棋
true, // 可以重复成三
false, // 多个“三连”只能提一子
true, // 可以提对手的“三连”子
true, // 摆棋满子闷棋只有12子棋才出现算先手负
true, // 走棋阶段不能行动(被“闷”)算负
false, // 剩三子时不可以飞棋
@ -73,6 +75,7 @@ const struct NineChess::Rule NineChess::RULES[N_RULES] = {
false, // 先摆棋者先行棋
false, // 不可以重复成三
true, // 出现几个“三连”就可以提几个子
false, // 不能提对手的“三连”子,除非无子可提;
true, // 摆棋满子闷棋只有12子棋才出现算先手负
false, // 走棋阶段不能行动(被“闷”),则由对手继续走棋
false, // 剩三子时不可以飞棋
@ -90,6 +93,7 @@ const struct NineChess::Rule NineChess::RULES[N_RULES] = {
false, // 先摆棋者先行棋
true, // 可以重复成三
false, // 多个“三连”只能提一子
false, // 不能提对手的“三连”子,除非无子可提;
true, // 摆棋满子闷棋只有12子棋才出现算先手负
true, // 走棋阶段不能行动(被“闷”)算负
true, // 剩三子时可以飞棋
@ -731,7 +735,8 @@ bool NineChess::capture(int c, int p, long time_p /* = -1*/)
return false;
// 如果当前子是否处于“三连”之中,且对方还未全部处于“三连”之中
if (isInMills(pos) && !isAllInMills(opponent)) {
if (currentRule.allowRemoveMill == false &&
isInMills(pos) && !isAllInMills(opponent)) {
return false;
}
@ -1034,7 +1039,8 @@ bool NineChess::capture(int pos)
return false;
// 如果当前子是否处于“三连”之中,且对方还未全部处于“三连”之中
if (isInMills(pos) && !isAllInMills(opponent)) {
if (currentRule.allowRemoveMill == false &&
isInMills(pos) && !isAllInMills(opponent)) {
return false;
}

View File

@ -64,6 +64,9 @@ public:
// 多个“三连”能否多提子
bool allowRemoveMultiPieces;
// 能否提“三连”的子
bool allowRemoveMill;
// 摆棋满子闷棋只有12子棋才出现是否算先手负false为和棋
bool isStartingPlayerLoseWhenBoardFull;