-/// 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();
- MoveStack* mlist_start = mlist;
-
- if (us == WHITE)
- mlist = generate_pawn_noncaptures<WHITE>(pos, mlist);
- else
- mlist = generate_pawn_noncaptures<BLACK>(pos, mlist);
-
- mlist = generate_piece_moves<KNIGHT>(pos, mlist, us, target);
- mlist = generate_piece_moves<BISHOP>(pos, mlist, us, target);
- mlist = generate_piece_moves<ROOK>(pos, mlist, us, target);
- mlist = generate_piece_moves<QUEEN>(pos, mlist, us, target);
- mlist = generate_piece_moves<KING>(pos, mlist, us, target);
- mlist = generate_castle_moves(pos, mlist);
- return int(mlist - mlist_start);
-}
-
-
-/// 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());
-
- Color us = pos.side_to_move();
- Square ksq = pos.king_square(opposite_color(us));
- MoveStack* mlist_start = mlist;
-
- assert(pos.piece_on(ksq) == king_of_color(opposite_color(us)));
-
- dc = pos.discovered_check_candidates(us);
-
- // Pawn moves
- if (us == WHITE)
- mlist = generate_pawn_checks<WHITE>(pos, dc, ksq, mlist);
- else
- mlist = generate_pawn_checks<BLACK>(pos, dc, ksq, mlist);
-
- // Pieces moves
- Bitboard b = pos.knights(us);
- if (b)
- mlist = generate_piece_checks<KNIGHT>(pos, b, dc, ksq, mlist);
-
- b = pos.bishops(us);
- if (b)
- mlist = generate_piece_checks<BISHOP>(pos, b, dc, ksq, mlist);
-
- b = pos.rooks(us);
- if (b)
- mlist = generate_piece_checks<ROOK>(pos, b, dc, ksq, mlist);
-
- b = pos.queens(us);
- if (b)
- mlist = generate_piece_checks<QUEEN>(pos, b, dc, ksq, mlist);
-
- // Hopefully we always have a king ;-)
- mlist = generate_piece_checks_king(pos, pos.king_square(us), dc, ksq, mlist);
-
- // TODO: Castling moves!
-
- return int(mlist - mlist_start);
-}