Skip to content

Commit

Permalink
made understandable again
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-maeder committed Sep 21, 2016
1 parent cb59adc commit 174c788
Showing 1 changed file with 39 additions and 20 deletions.
59 changes: 39 additions & 20 deletions conditions/football.c
Expand Up @@ -134,31 +134,12 @@ static boolean advance_substitution(void)
return result;
}

/* Try to solve in solve_nr_remaining half-moves.
* @param si slice index
* @note assigns solve_result the length of solution found and written, i.e.:
* previous_move_is_illegal the move just played is illegal
* this_move_is_illegal the move being played is illegal
* immobility_on_next_move the moves just played led to an
* unintended immobility on the next move
* <=n+1 length of shortest solution found (n+1 only if in next
* branch)
* n+2 no solution found in this branch
* n+3 no solution found in next branch
* (with n denominating solve_nr_remaining)
*/
void football_chess_substitutor_solve(slice_index si)
static void try_current_substitute(slice_index si)
{
TraceFunctionEntry(__func__);
TraceFunctionParam("%u",si);
TraceFunctionParamListEnd();

if (!post_move_am_i_iterating())
init_substitution();

if (current_football_substitution[nbply]==Empty)
pipe_solve_delegate(si);
else
{
move_effect_journal_index_type const base = move_effect_journal_base[nbply];
move_effect_journal_index_type const movement = base+move_effect_journal_index_offset_movement;
Expand All @@ -183,6 +164,44 @@ void football_chess_substitutor_solve(slice_index si)
TraceFunctionResultEnd();
}

/* Try to solve in solve_nr_remaining half-moves.
* @param si slice index
* @note assigns solve_result the length of solution found and written, i.e.:
* previous_move_is_illegal the move just played is illegal
* this_move_is_illegal the move being played is illegal
* immobility_on_next_move the moves just played led to an
* unintended immobility on the next move
* <=n+1 length of shortest solution found (n+1 only if in next
* branch)
* n+2 no solution found in this branch
* n+3 no solution found in next branch
* (with n denominating solve_nr_remaining)
*/
void football_chess_substitutor_solve(slice_index si)
{
TraceFunctionEntry(__func__);
TraceFunctionParam("%u",si);
TraceFunctionParamListEnd();

if (!post_move_am_i_iterating())
{
init_substitution();
if (current_football_substitution[nbply]==Empty)
{
post_move_iteration_solve_delegate(si);
if (!post_move_iteration_is_locked())
post_move_iteration_end();
}
else
try_current_substitute(si);
}
else
try_current_substitute(si);

TraceFunctionExit(__func__);
TraceFunctionResultEnd();
}

/* Instrument slices with promotee markers
*/
void solving_insert_football_chess(slice_index si)
Expand Down

0 comments on commit 174c788

Please sign in to comment.