mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-06-13 03:44:06 +00:00
gobot:: ko rule checking
This commit is contained in:
parent
0167e284cc
commit
a830fa73b3
@ -362,6 +362,16 @@ void try_to_play(string s, int who) {
|
|||||||
dead_group(i);
|
dead_group(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int steps = 0;
|
||||||
|
for(int it=isize(history)-1; it>=0; it--) {
|
||||||
|
steps++;
|
||||||
|
if(history[it].taken == current.taken) {
|
||||||
|
go_message("This position repeated " + its(steps) + " moves back. Say 'undo' to cancel this move");
|
||||||
|
}
|
||||||
|
if(history[it].captures[0] == 0 && history[it].captures[1] == 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if(count_breath(pos) == 0) {
|
if(count_breath(pos) == 0) {
|
||||||
current.taken[pos] = Free;
|
current.taken[pos] = Free;
|
||||||
go_message("suicidal move at " + s);
|
go_message("suicidal move at " + s);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user