/* Generate moves for a piece with a specific walk from a specific departure * square. * @note the piece on the departure square need not necessarily have walk p */ void marscirce_remove_capturer_solve(slice_index si) { circe_rebirth_context_elmt_type * const context = &circe_rebirth_context_stack[circe_rebirth_context_stack_pointer]; square const sq_departure = context->rebirth_from; piece_walk_type const walk = get_walk_of_piece_on_square(sq_departure); Flags const flags = being_solved.spec[sq_departure]; TraceFunctionEntry(__func__); TraceFunctionParam("%u",si); TraceFunctionParamListEnd(); assert(walk!=Empty); empty_square(sq_departure); pipe_dispatch_delegate(si); occupy_square(sq_departure,walk,flags); TraceFunctionExit(__func__); 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 circe_assassin_assassinate_solve(slice_index si) { circe_rebirth_context_elmt_type const * const context = &circe_rebirth_context_stack[circe_rebirth_context_stack_pointer]; square const sq_rebirth = context->rebirth_square; Flags const mask = BIT(SLICE_STARTER(si))|BIT(Royal); TraceFunctionEntry(__func__); TraceFunctionParam("%u",si); TraceFunctionParamListEnd(); if (TSTFULLFLAGMASK(being_solved.spec[sq_rebirth],mask)) solve_result = this_move_is_illegal; else { move_effect_journal_do_piece_removal(move_effect_reason_assassin_circe_rebirth, sq_rebirth); pipe_dispatch_delegate(si); } TraceFunctionExit(__func__); TraceFunctionResultEnd(); }