/* Generate moves for a marine rider * @param kbeg,kend delimiters of interval in vector table */ void marine_rider_generate_moves(vec_index_type kbeg, vec_index_type kend) { vec_index_type k; TraceFunctionEntry(__func__); TraceFunctionParam("%u",kbeg); TraceFunctionParam("%u",kend); TraceFunctionParamListEnd(); for (k = kbeg; k<=kend; k++) { square const sq_capture = generate_moves_on_line_segment(curr_generation->departure,k); generate_locust_capture(sq_capture,vec[k]); } TraceFunctionExit(__func__); TraceFunctionResultEnd(); }
/* Generate moves for a rider piece * @param kbeg start of range of vector indices to be used * @param kend end of range of vector indices to be used */ void rider_generate_moves(vec_index_type kbeg, vec_index_type kend) { /* generate rider moves from vec[kbeg] to vec[kend] */ vec_index_type k; TraceFunctionEntry(__func__); TraceFunctionParam("%u",kbeg); TraceFunctionParam("%u",kend); TraceFunctionParamListEnd(); for (k = kbeg; k<=kend; ++k) { curr_generation->arrival = generate_moves_on_line_segment(curr_generation->departure,k); if (piece_belongs_to_opponent(curr_generation->arrival)) push_move(); } TraceFunctionExit(__func__); TraceFunctionResultEnd(); }
/* Generate moves for a chinese rider piece * @param kbeg start of range of vector indices to be used * @param kend end of range of vector indices to be used */ void chinese_rider_generate_moves(vec_index_type kbeg, vec_index_type kend) { vec_index_type k; for (k = kbeg; k<=kend; ++k) { numecoup const base = current_move[nbply]; square const sq_hurdle = generate_moves_on_line_segment(curr_generation->departure,k); /* avoid accidentally "inheriting" the hurdle from some previous move */ hoppers_clear_hurdles(base); if (!is_square_blocked(sq_hurdle)) { curr_generation->arrival = find_end_of_line(sq_hurdle,vec[k]); if (piece_belongs_to_opponent(curr_generation->arrival)) hoppers_push_move(k,sq_hurdle); } } }