Skip to content

Commit

Permalink
120 possible undo Moves. If Black "passes" each move.
Browse files Browse the repository at this point in the history
  • Loading branch information
oers committed Nov 19, 2024
1 parent e6329c3 commit 1e46634
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions project/src/main/jni/droidzebra-jni.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static int s_practice_mode = FALSE;
static const char* s_forced_opening_seq = NULL;
static int s_use_book = TRUE;
static int s_enable_msg = TRUE;
static int s_undo_stack[128];
static int s_undo_stack[120]; //60 black and 60 White Moves. A move can be "PASS"
static int s_undo_stack_pointer = 0;
// --

Expand Down Expand Up @@ -1023,10 +1023,7 @@ void _droidzebra_undo_all(int* side_to_move)
if(score_sheet_row==0 && *side_to_move==BLACKSQ) return;

do {
droidzebra_message_debug("undoall Before: %d", s_undo_stack_pointer);

_droidzebra_undo_stack_push(disks_played);
droidzebra_message_debug("undoall After: %d", s_undo_stack_pointer);

*side_to_move = OPP(*side_to_move);

Expand Down Expand Up @@ -1127,7 +1124,7 @@ void _droidzebra_throw_engine_error(JNIEnv* env, const char* msg)

void _droidzebra_undo_stack_push(int val)
{
assert(s_undo_stack_pointer< 128);
assert(s_undo_stack_pointer< 120);
s_undo_stack[s_undo_stack_pointer++] = val;
}

Expand Down

0 comments on commit 1e46634

Please sign in to comment.