-/// generate_captures generates() all pseudo-legal captures and queen
-/// promotions. The return value is the number of moves generated.
-
-int generate_captures(const Position& pos, MoveStack* mlist) {
-
- assert(pos.is_ok());
- assert(!pos.is_check());
-
- Color us = pos.side_to_move();
- Bitboard target = pos.pieces_of_color(opposite_color(us));
- int n;
-
- if (us == WHITE)
- n = generate_pawn_captures<WHITE>(pos, mlist);
- else
- n = generate_pawn_captures<BLACK>(pos, mlist);
-
- n += generate_piece_moves<KNIGHT>(pos, mlist+n, target);
- n += generate_piece_moves<BISHOP>(pos, mlist+n, target);
- n += generate_piece_moves<ROOK>(pos, mlist+n, target);
- n += generate_piece_moves<QUEEN>(pos, mlist+n, target);
- n += generate_piece_moves<KING>(pos, mlist+n, target);
- return n;
-}
-
-
-/// generate_noncaptures() generates all pseudo-legal non-captures and
-/// underpromotions. The return value is the number of moves generated.
-
-int generate_noncaptures(const Position& pos, MoveStack *mlist) {
-
- assert(pos.is_ok());
- assert(!pos.is_check());
-
- Color us = pos.side_to_move();
- Bitboard target = pos.empty_squares();
- int n;
-
- if (us == WHITE)
- n = generate_pawn_noncaptures<WHITE>(pos, mlist);
- else
- n = generate_pawn_noncaptures<BLACK>(pos, mlist);
-
- n += generate_piece_moves<KNIGHT>(pos, mlist+n, target);
- n += generate_piece_moves<BISHOP>(pos, mlist+n, target);
- n += generate_piece_moves<ROOK>(pos, mlist+n, target);
- n += generate_piece_moves<QUEEN>(pos, mlist+n, target);
- n += generate_piece_moves<KING>(pos, mlist+n, target);
- n += generate_castle_moves(pos, mlist+n);
- return n;
-}
-
-
-/// generate_checks() generates all pseudo-legal non-capturing, non-promoting
-/// checks, except castling moves (will add this later). It returns the
-/// number of generated moves.
-
-int generate_checks(const Position& pos, MoveStack* mlist, Bitboard dc) {
-
- assert(pos.is_ok());
- assert(!pos.is_check());
-
- int n;
- Color us = pos.side_to_move();
- Square ksq = pos.king_square(opposite_color(us));