本文整理汇总了C++中TraceSquare函数的典型用法代码示例。如果您正苦于以下问题:C++ TraceSquare函数的具体用法?C++ TraceSquare怎么用?C++ TraceSquare使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TraceSquare函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PushMagicView
static void PushMagicView(square pos_viewed, square pos_magic, square start, square end)
{
unsigned int const top = magic_views_top[stack_pointer];
TraceFunctionEntry(__func__);
TraceSquare(pos_viewed);
TraceSquare(pos_magic);
TraceSquare(start);
TraceSquare(end);
TraceFunctionParamListEnd();
assert(magic_views_top[stack_pointer]<magicviews_size);
magicviews[top].pos_viewed = pos_viewed;
magicviews[top].viewedid = GetPieceId(being_solved.spec[pos_viewed]);
magicviews[top].magicpieceid = GetPieceId(being_solved.spec[pos_magic]);
magicviews[top].line_start = start;
magicviews[top].line_end = end;
++magic_views_top[stack_pointer];
TraceValue("%u",stack_pointer);
TraceValue("%u\n",magic_views_top[stack_pointer]);
TraceFunctionExit(__func__);
TraceFunctionResultEnd();
}
示例2: riders_check
boolean riders_check(vec_index_type kanf, vec_index_type kend,
validator_id evaluate)
{
square const sq_target = move_generation_stack[CURRMOVE_OF_PLY(nbply)].capture;
boolean result = false;
TraceFunctionEntry(__func__);
TraceSquare(sq_target);
TraceFunctionParamListEnd();
++observation_context;
TraceEnumerator(Side,trait[nbply],"\n");
for (interceptable_observation[observation_context].vector_index1 = kanf;
interceptable_observation[observation_context].vector_index1<= kend;
++interceptable_observation[observation_context].vector_index1)
{
square const sq_departure = find_end_of_line(sq_target,vec[interceptable_observation[observation_context].vector_index1]);
TraceSquare(sq_departure);TraceEOL();
if (EVALUATE_OBSERVATION(evaluate,sq_departure,sq_target))
{
result = true;
break;
}
}
--observation_context;
TraceFunctionExit(__func__);
TraceFunctionResult("%u",result);
TraceFunctionResultEnd();
return result;
}
示例3: are_all_imitator_arrivals_empty
static boolean are_all_imitator_arrivals_empty(square sq_departure, square sq_arrival)
{
unsigned int imi_idx;
int const diff = sq_arrival-sq_departure;
boolean result = true;
TraceFunctionEntry(__func__);
TraceSquare(sq_departure);
TraceSquare(sq_arrival);
TraceFunctionParamListEnd();
for (imi_idx = being_solved.number_of_imitators; imi_idx>0; imi_idx--)
{
square const j2 = being_solved.isquare[imi_idx-1]+diff;
if (j2!=sq_departure && !is_square_empty(j2))
{
result = false;
break;
}
}
TraceFunctionExit(__func__);
TraceFunctionResult("%u",result);
TraceFunctionResultEnd();
return result;
}
示例4: rider_placed
static void rider_placed(void)
{
rider_placement_stack_elmt_type const * const save_top = stack_top;
TraceFunctionEntry(__func__);
TraceSquare(stack_top->placed_on);
TraceFunctionParamListEnd();
stack_top = stack_top->next;
if (being_solved.king_square[White]==initsquare)
(*save_top->go_on)();
else
{
int const check_diff = being_solved.king_square[White]-save_top->placed_on;
int const check_dir = CheckDir[get_walk_of_piece_on_square(save_top->placed_on)][check_diff];
assert(check_dir!=check_diff);
if (check_dir!=0
&& is_line_empty(save_top->placed_on,being_solved.king_square[White],check_dir))
intelligent_intercept_check_by_black(check_dir,save_top->go_on);
else
(*save_top->go_on)();
}
assert(stack_top==save_top->next);
stack_top = save_top;
TraceFunctionExit(__func__);
TraceFunctionResultEnd();
}
示例5: pawn_get_no_capture_length
unsigned int pawn_get_no_capture_length(Side side, square sq_departure)
{
unsigned int result;
SquareFlags const base_square = WhBaseSq+side;
SquareFlags const doublestep_square = WhPawnDoublestepSq+side;
TraceFunctionEntry(__func__);
TraceEnumerator(Side,side);
TraceSquare(sq_departure);
TraceFunctionParamListEnd();
if (TSTFLAG(sq_spec[sq_departure],base_square))
{
if (CondFlag[einstein])
result = 3;
else if (circe_variant.determine_rebirth_square==circe_determine_rebirth_square_equipollents
|| CondFlag[normalp]
|| circe_variant.determine_rebirth_square==circe_determine_rebirth_square_cage
|| get_walk_of_piece_on_square(sq_departure)==Orphan /* we are generating for a pawned Orphan! */
|| TSTFLAG(sq_spec[sq_departure],Wormhole))
result = 1;
else
result = 0;
}
else if (TSTFLAG(sq_spec[sq_departure],doublestep_square))
result = 2;
else
result = 1;
TraceFunctionExit(__func__);
TraceFunctionResult("%u",result);
TraceFunctionResultEnd();
return result;
}
示例6: marscirce_is_square_observed
/* Determine whether a specific piece delivers check to a specific side
* @param observer_origin potentially delivering check ...
* @note the piece on pos_checking must belong to advers(side)
* @note sets observation_result
*/
void marscirce_is_square_observed(slice_index si)
{
circe_rebirth_context_elmt_type * const context = &circe_rebirth_context_stack[circe_rebirth_context_stack_pointer-1];
square const sq_target = move_generation_stack[CURRMOVE_OF_PLY(nbply)].capture;
TraceFunctionEntry(__func__);
TraceValue("%u",si);
TraceFunctionParamListEnd();
assert(circe_rebirth_context_stack_pointer>0);
observation_result = false;
if (observing_walk[nbply]<Queen || observing_walk[nbply]>Bishop
|| CheckDir[observing_walk[nbply]][sq_target-context->rebirth_square]!=0)
{
if (is_square_empty(context->rebirth_square))
{
TraceSquare(context->rebirth_square);
TraceWalk(context->reborn_walk);
TraceValue("%u",TSTFLAG(being_solved.spec[context->rebirth_square],White));
TraceValue("%u",TSTFLAG(being_solved.spec[context->rebirth_square],Black));
TraceEOL();
occupy_square(context->rebirth_square,context->reborn_walk,context->reborn_spec);
pipe_is_square_observed_delegate(si);
empty_square(context->rebirth_square);
}
}
TraceFunctionExit(__func__);
TraceFunctionResultEnd();
}
示例7: remove_illegal_moves_by_same_mao
static numecoup remove_illegal_moves_by_same_mao(numecoup curr, numecoup *new_top)
{
square const sq_departure = move_generation_stack[curr].departure;
TraceFunctionEntry(__func__);
TraceValue("%u",curr);
TraceSquare(sq_departure);
TraceFunctionParamListEnd();
while (curr<=CURRMOVE_OF_PLY(nbply)
&& move_generation_stack[curr].departure==sq_departure)
{
square const sq_arrival = move_generation_stack[curr].arrival;
square const sq_hurdle = hoppper_moves_auxiliary[move_generation_stack[curr].id].sq_hurdle;
if (are_all_imitator_arrivals_empty(sq_departure,sq_hurdle)
&& are_all_imitator_arrivals_empty(sq_departure,sq_arrival))
{
++*new_top;
move_generation_stack[*new_top] = move_generation_stack[curr];
}
++curr;
}
TraceFunctionExit(__func__);
TraceFunctionResult("%u",curr);
TraceFunctionResultEnd();
return curr;
}
示例8: intelligent_place_pinned_black_piece
void intelligent_place_pinned_black_piece(unsigned int placed_index,
square placed_on,
void (*go_on)(void))
{
TraceFunctionEntry(__func__);
TraceFunctionParam("%u",placed_index);
TraceSquare(placed_on);
TraceFunctionParamListEnd();
switch (black[placed_index].type)
{
case Queen:
case Rook:
case Bishop:
intelligent_place_pinned_black_rider(placed_index,placed_on,go_on);
break;
case Knight:
intelligent_place_pinned_black_knight(placed_index,placed_on,go_on);
break;
case Pawn:
intelligent_place_pinned_promoted_black_pawn(placed_index,placed_on,go_on);
intelligent_place_pinned_unpromoted_black_pawn(placed_index,placed_on,go_on);
break;
default:
assert(0);
break;
}
TraceFunctionExit(__func__);
TraceFunctionResultEnd();
}
示例9: intelligent_place_black_rider
void intelligent_place_black_rider(unsigned int placed_index,
square placed_on,
void (*go_on)(void))
{
piece_walk_type const intercepter_type = black[placed_index].type;
square const placed_comes_from = black[placed_index].diagram_square;
int const check_diff = being_solved.king_square[White]-placed_on;
int const check_dir = CheckDir[intercepter_type][check_diff];
TraceFunctionEntry(__func__);
TraceFunctionParam("%u",placed_index);
TraceSquare(placed_on);
TraceFunctionParamListEnd();
if (check_dir!=check_diff
&& intelligent_reserve_officer_moves_from_to(Black,
placed_comes_from,
intercepter_type,
placed_on))
{
place_rider(placed_index,intercepter_type,placed_on,go_on);
intelligent_unreserve();
}
TraceFunctionExit(__func__);
TraceFunctionResultEnd();
}
示例10: intelligent_place_pinned_promoted_black_knight
void intelligent_place_pinned_promoted_black_knight(unsigned int placed_index,
square placed_on,
void (*go_on)(void))
{
square const placed_comes_from = black[placed_index].diagram_square;
Flags const placed_flags = black[placed_index].flags;
TraceFunctionEntry(__func__);
TraceFunctionParam("%u",placed_index);
TraceSquare(placed_on);
TraceFunctionParamListEnd();
if ((being_solved.king_square[White]==initsquare
|| CheckDir[Knight][being_solved.king_square[White]-placed_on]==0)
&& intelligent_reserve_promoting_black_pawn_moves_from_to(placed_comes_from,
Knight,
placed_on))
{
occupy_square(placed_on,Knight,placed_flags);
(*go_on)();
intelligent_unreserve();
}
TraceFunctionExit(__func__);
TraceFunctionResultEnd();
}
示例11: by_promoted_pawn
static void by_promoted_pawn(slice_index si,
unsigned int index_of_checker,
square const check_from)
{
TraceFunctionEntry(__func__);
TraceFunctionParam("%u",index_of_checker);
TraceSquare(check_from);
TraceFunctionParamListEnd();
if (intelligent_can_promoted_white_pawn_theoretically_move_to(index_of_checker,
check_from))
{
piece_walk_type pp;
for (pp = pieces_pawns_promotee_sequence[pieces_pawns_promotee_chain_orthodox][Empty]; pp!=Empty; pp = pieces_pawns_promotee_sequence[pieces_pawns_promotee_chain_orthodox][pp])
switch (pp)
{
case Queen:
case Rook:
case Bishop:
by_promoted_rider(si,index_of_checker,pp,check_from);
break;
case Knight:
by_promoted_knight(si,index_of_checker,check_from);
break;
default:
assert(0);
break;
}
}
TraceFunctionExit(__func__);
TraceFunctionResultEnd();
}
示例12: init_disturb_mate_rider_onedir
static void init_disturb_mate_rider_onedir(square target, int dir, unsigned int index)
{
square s;
enum
{
nr_DisturbMateDirRider = sizeof DisturbMateDirRider / sizeof DisturbMateDirRider[0]
};
TraceFunctionEntry(__func__);
TraceSquare(target);
TraceFunctionParam("%d",dir);
TraceFunctionParam("%u",index);
TraceFunctionParamListEnd();
assert(index<nr_DisturbMateDirRider);
for (s = target+2*dir; is_square_empty(s); s += dir)
{
DisturbMateDirRider[index][s].dir = -dir;
DisturbMateDirRider[index][s].target = target;
}
for (s = target-2*dir; is_square_empty(s); s -= dir)
{
DisturbMateDirRider[index][s].dir = dir;
DisturbMateDirRider[index][s].target = target;
}
DisturbMateDirRider[index][target+dir].dir = disturbance_by_rider_uninterceptable;
DisturbMateDirRider[index][target-dir].dir = disturbance_by_rider_uninterceptable;
TraceFunctionExit(__func__);
TraceFunctionResultEnd();
}
示例13: en_passant_is_capture_possible_to
/* Is an en passant capture possible to a specific square?
* @param side for which side
* @param s the square
* @return true iff an en passant capture to s is currently possible
*/
boolean en_passant_is_capture_possible_to(Side side, square s)
{
boolean result = false;
ply const ply_parent = parent_ply[nbply];
TraceFunctionEntry(__func__);
TraceEnumerator(Side,side);
TraceSquare(s);
TraceFunctionParamListEnd();
TraceEnumerator(Side,trait[ply_parent]);
TraceEOL();
if (trait[ply_parent]!=side)
{
unsigned int i;
for (i = en_passant_top[ply_parent-1]+1; i<=en_passant_top[ply_parent]; ++i)
if (en_passant_multistep_over[i]==s)
{
result = true;
break;
}
}
TraceFunctionExit(__func__);
TraceFunctionResult("%u",result);
TraceFunctionResultEnd();
return result;
}
示例14: advance_mate_square
/* Find a square for the opposite king
* @param side side looking for a square for the opposite king
*/
static void advance_mate_square(Side side)
{
Side const other_side = advers(side);
TraceFunctionEntry(__func__);
TraceEnumerator(Side,side,"");
TraceFunctionParamListEnd();
assert(republican_goal.type==goal_mate);
being_solved.king_square[other_side] = king_placement[nbply]+1;
++being_solved.number_of_pieces[other_side][King];
while (being_solved.king_square[other_side]<=square_h8)
if (is_mate_square(other_side))
break;
else
++being_solved.king_square[other_side];
--being_solved.number_of_pieces[other_side][King];
king_placement[nbply] = being_solved.king_square[other_side];
being_solved.king_square[other_side] = initsquare;
TraceSquare(king_placement[nbply]);TraceEOL();
TraceFunctionExit(__func__);
TraceFunctionResultEnd();
}
示例15: is_mate_square
static boolean is_mate_square(Side other_side)
{
boolean result = false;
if (is_square_empty(being_solved.king_square[other_side]))
{
TraceFunctionEntry(__func__);
TraceEnumerator(Side,other_side,"");
TraceFunctionParamListEnd();
TraceSquare(being_solved.king_square[other_side]);TraceEOL();
occupy_square(being_solved.king_square[other_side],King,BIT(Royal)|BIT(other_side));
if (conditional_pipe_solve_delegate(temporary_hack_mate_tester[other_side])
==previous_move_has_solved)
result = true;
empty_square(being_solved.king_square[other_side]);
TraceFunctionExit(__func__);
TraceFunctionResult("%u",result);
TraceFunctionResultEnd();
}
return result;
}