static void HandleAddedPiece(square s, void *param) { piece_addition_settings * const settings = param; if (!is_square_empty(s)) { if (settings->type==piece_addition_initial) { WriteSquare(&output_plaintext_engine,stdout,s); output_plaintext_message(OverwritePiece); underworld_make_space(nr_ghosts); underworld[nr_ghosts-1].walk = get_walk_of_piece_on_square(s); underworld[nr_ghosts-1].flags = being_solved.spec[s]; underworld[nr_ghosts-1].on = s; } else { move_effect_journal_do_circe_volcanic_remember(move_effect_reason_diagram_setup, s); move_effect_journal_do_piece_removal(move_effect_reason_diagram_setup, s); } } if (settings->type==piece_addition_twinning) move_effect_journal_do_piece_creation(move_effect_reason_diagram_setup, s,settings->walk, settings->spec, no_side); else occupy_square(s,settings->walk,settings->spec); }
static void SignalExclusiveRefutedUndecidable(void) { output_plaintext_tree_write_move(); protocol_fputc(' ',stdout); output_plaintext_message(ExclusiveRefutedUndecidable); protocol_fputc('\n',stdout); solve_result = previous_move_is_illegal; }
/* Apply the option postkeyplay to a newly created stipulation * @param si identifies the postkeyplay applier slice */ void post_key_play_stipulation_modifier_solve(slice_index si) { TraceFunctionEntry(__func__); TraceFunctionParam("%u",si); TraceFunctionParamListEnd(); { slice_index const stipulation_root_hook = stipulation_modifier_to_be_modified(si); if (stipulation_root_hook!=no_slice) { if (!battle_branch_apply_postkeyplay(stipulation_root_hook)) output_plaintext_message(PostKeyPlayNotApplicable); } } pipe_solve_delegate(si); TraceFunctionExit(__func__); TraceFunctionParamListEnd(); }
/* 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 ohneschach_detect_undecidable_goal_solve(slice_index si) { TraceFunctionEntry(__func__); TraceFunctionParam("%u",si); TraceFunctionParamListEnd(); TraceValue("%u",nbply); TraceValue("%u",ohneschach_undecidable_goal_detected[nbply+1]); TraceEOL(); if (ohneschach_undecidable_goal_detected[nbply+1]) { ohneschach_undecidable_goal_detected[nbply+1] = false; solve_result = previous_move_is_illegal; output_plaintext_message(ChecklessUndecidable); } else pipe_solve_delegate(si); TraceFunctionExit(__func__); TraceFunctionResultEnd(); }
static void SignalChecklessUndecidable(void) { output_plaintext_tree_write_move(); protocol_fputc(' ',stdout); output_plaintext_message(ChecklessUndecidable); }
static void write_refuting_varation(unsigned move_depth) { output_plaintext_message(NewLine); protocol_fprintf(stdout,"%*c",4*move_depth,' '); output_plaintext_message(Refutation); }