コード例 #1
0
/* Generate moves for a single piece
 * @param identifies generator slice
 */
void transmuting_kings_generate_moves_for_piece(slice_index si)
{
  Flags const mask = BIT(trait[nbply])|BIT(Royal);

  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  if (TSTFULLFLAGMASK(being_solved.spec[curr_generation->departure],mask))
  {
    if (!generate_moves_of_transmuting_king(si))
      pipe_move_generation_delegate(si);
  }
  else
    pipe_move_generation_delegate(si);

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
コード例 #2
0
ファイル: move_generator.c プロジェクト: punund/popeye
/* Generate moves for a piece with a specific walk from a specific departure
 * square.
 */
void generate_moves_for_piece_two_paths(slice_index si)
{
  TraceFunctionEntry(__func__);
  TraceFunctionParamListEnd();

  pipe_move_generation_delegate(si);
  fork_move_generation_delegate(si);

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
コード例 #3
0
ファイル: central.c プロジェクト: Die9teWoge/popeye
/* Generate moves for a single piece
 * @param identifies generator slice
 */
void central_generate_moves_for_piece(slice_index si)
{
  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  if (is_mover_supported(current_generation))
    pipe_move_generation_delegate(si);

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
コード例 #4
0
ファイル: marscirce.c プロジェクト: thomas-maeder/popeye
/* 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_generate_moves_enforce_rex_exclusive(slice_index si)
{
  TraceFunctionEntry(__func__);
  TraceValue("%u",si);
  TraceFunctionParamListEnd();

  if (!TSTFLAG(being_solved.spec[curr_generation->departure],Royal))
    pipe_move_generation_delegate(si);

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
コード例 #5
0
ファイル: disparate.c プロジェクト: punund/popeye
/* Generate moves for a single piece
 * @param identifies generator slice
 */
void disparate_generate_moves_for_piece(slice_index si)
{
  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  if (can_piece_move(current_generation))
    pipe_move_generation_delegate(si);

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
コード例 #6
0
/* Iterate if move generation uses a post-move iterating slice (e.g. for
 * MarsCirce Super)
 * @param si identifies move generator slice
 */
void move_generation_post_move_iterator_solve(slice_index si)
{
  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  do
  {
    post_move_iteration_locked[nbply] = false;
    pipe_move_generation_delegate(si);
  } while (post_move_iteration_locked[nbply]);

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
コード例 #7
0
/* Iterate if move generation uses a post-move iterating slice (e.g. for
 * MarsCirce Super)
 * @param si identifies move generator slice
 */
void move_generation_post_move_iterator_solve(slice_index si)
{
  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  do
  {
    pipe_move_generation_delegate(si);
    TraceValue("%u",iteration_level);TraceValue("%u",current_level);TraceEOL();
  } while (iteration_level>current_level);

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
コード例 #8
0
ファイル: marscirce.c プロジェクト: thomas-maeder/popeye
/* 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_remember_rebirth(slice_index si)
{
  numecoup curr_id = current_move_id[nbply];

  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  pipe_move_generation_delegate(si);

  for (; curr_id<current_move_id[nbply]; ++curr_id)
    marscirce_rebirth_square[curr_id] = curr_generation->departure;

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
コード例 #9
0
ファイル: marscirce.c プロジェクト: thomas-maeder/popeye
/* 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_fix_departure(slice_index si)
{
  numecoup const base = CURRMOVE_OF_PLY(nbply);
  numecoup curr;

  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  pipe_move_generation_delegate(si);

  for (curr = base+1; curr<=CURRMOVE_OF_PLY(nbply); ++curr)
    move_generation_stack[curr].departure = curr_generation->departure;

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
コード例 #10
0
ファイル: facetoface.c プロジェクト: Die9teWoge/popeye
static void generate_moves_for_possibly_confronted_piece(slice_index si,
                                                         numvec dir_confronter)
{
  square const confronter_pos = curr_generation->departure+dir_confronter;

  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  if (TSTFLAG(being_solved.spec[confronter_pos],advers(trait[nbply])))
    pipe_move_generation_differnt_walk_delegate(si,get_walk_of_piece_on_square(confronter_pos));
  else
    pipe_move_generation_delegate(si);

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
コード例 #11
0
ファイル: annan.c プロジェクト: Die9teWoge/popeye
/* Generate moves for a single piece
 * @param identifies generator slice
 */
void annan_generate_moves_for_piece(slice_index si)
{
  int const annaniser_dir = trait[nbply]==White ? -onerow : +onerow;
  square const annaniser_pos = curr_generation->departure+annaniser_dir;

  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceFunctionParamListEnd();

  if (annanises(trait[nbply],annaniser_pos,curr_generation->departure))
    pipe_move_generation_differnt_walk_delegate(si,get_walk_of_piece_on_square(annaniser_pos));
  else
    pipe_move_generation_delegate(si);

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
コード例 #12
0
ファイル: marscirce.c プロジェクト: thomas-maeder/popeye
/* 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_generate_from_rebirth_square(slice_index si)
{
  circe_rebirth_context_elmt_type * const context = &circe_rebirth_context_stack[circe_rebirth_context_stack_pointer-1];
  square const sq_departure = curr_generation->departure;
  square const sq_rebirth = context->rebirth_square;

  TraceFunctionEntry(__func__);
  TraceFunctionParam("%u",si);
  TraceSquare(sq_rebirth);
  TraceFunctionParamListEnd();

  assert(circe_rebirth_context_stack_pointer>0);

  curr_generation->departure = sq_rebirth;

  occupy_square(sq_rebirth,context->reborn_walk,context->reborn_spec);
  pipe_move_generation_delegate(si);
  empty_square(sq_rebirth);

  curr_generation->departure = sq_departure;

  TraceFunctionExit(__func__);
  TraceFunctionResultEnd();
}
コード例 #13
0
ファイル: move_generator.c プロジェクト: punund/popeye
/* Reject generated non-captures
 * @param si identifies the slice
 */
void move_generation_reject_non_captures(slice_index si)
{
  numecoup const base = CURRMOVE_OF_PLY(nbply);
  pipe_move_generation_delegate(si);
  move_generator_filter_noncaptures(base,&always_reject);
}