2 Glaurung, a UCI chess playing engine.
3 Copyright (C) 2004-2008 Tord Romstad
5 Glaurung is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 Glaurung is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #if !defined MOVEPICK_H_INCLUDED
21 #define MOVEPICK_H_INCLUDED
36 /// MovePicker is a class which is used to pick one legal move at a time from
37 /// the current position. It is initialized with a Position object and a few
38 /// moves we have reason to believe are good. The most important method is
39 /// MovePicker::pick_next_move(), which returns a new legal move each time it
40 /// is called, until there are no legal moves left, when MOVE_NONE is returned.
41 /// In order to improve the efficiency of the alpha beta algorithm, MovePicker
42 /// attempts to return the moves which are most likely to be strongest first.
47 MovePicker(Position &p, bool pvnode, Move ttm, Move mk, Move k1, Move k2,
50 Move get_next_move(Lock &lock);
51 int number_of_moves() const;
52 int current_move_score() const;
53 Bitboard discovered_check_candidates();
55 static void init_phase_table();
58 void score_captures();
59 void score_noncaptures();
60 void score_evasions();
61 void score_qcaptures();
62 Move pick_move_from_list();
65 Move ttMove, mateKiller, killer1, killer2;
67 MoveStack moves[256], badCaptures[64];
71 int numOfMoves, numOfBadCaptures;
72 int movesPicked, badCapturesPicked;
81 /// MovePicker::discovered_check_candidates() returns a bitboard containing
82 /// all pieces which can possibly give discovered check. This bitboard is
83 /// computed by the constructor function.
85 inline Bitboard MovePicker::discovered_check_candidates() {
89 #endif // !defined(MOVEPICK_H_INCLUDED)