/// search captures, promotions and some checks) and about how important good
/// move ordering is at the current node.
-MovePicker::MovePicker(const Position& p, bool pv, Move ttm, Depth d, SearchStack* ss) : pos(p) {
+MovePicker::MovePicker(const Position& p, bool pv, Move ttm, Depth d,
+ const History& h, SearchStack* ss) : pos(p), H(h) {
pvNode = pv;
ttMove = ttm;
////
#include "depth.h"
+#include "history.h"
#include "lock.h"
#include "position.h"
PH_STOP
};
- MovePicker(const Position& p, bool pvnode, Move ttm, Depth d, SearchStack* ss = NULL);
+ MovePicker(const Position& p, bool pvnode, Move ttm, Depth d, const History& h, SearchStack* ss = NULL);
Move get_next_move();
Move get_next_move(Lock& lock);
int number_of_moves() const;
Move pick_move_from_list();
const Position& pos;
+ const History& H;
Move ttMove, mateKiller, killer1, killer2;
Bitboard pinned, dc;
MoveStack moves[256], badCaptures[64];
#include <string>
#include <sstream>
+#include "history.h"
#include "movepick.h"
#include "san.h"
assert(pos.is_ok());
- MovePicker mp = MovePicker(pos, false, MOVE_NONE, OnePly);
+ MovePicker mp = MovePicker(pos, false, MOVE_NONE, OnePly, History());
// Castling moves
if (movestr == "O-O-O" || movestr == "O-O-O+")
if (type_of_piece(pc) == KING)
return AMBIGUITY_NONE;
- MovePicker mp = MovePicker(pos, false, MOVE_NONE, OnePly);
+ MovePicker mp = MovePicker(pos, false, MOVE_NONE, OnePly, History());
Move mv, moveList[8];
int n = 0;
// Search depth at iteration 1
const Depth InitialDepth = OnePly /*+ OnePly/2*/;
+ // History tables
+ History H;
+
// Node counters
int NodesSincePoll;
int NodesBetweenPolls = 30000;
// but it could turn out to be useful for debugging.
Lock IOLock;
-History H; // Should be made local?
-
// SearchStack::init() initializes a search stack. Used at the beginning of a
// new search from the root.
// Initialize a MovePicker object for the current position, and prepare
// to search all moves
- MovePicker mp = MovePicker(pos, true, ttMove, depth, &ss[ply]);
+ MovePicker mp = MovePicker(pos, true, ttMove, depth, H, &ss[ply]);
Move move, movesSearched[256];
int moveCount = 0;
// Initialize a MovePicker object for the current position, and prepare
// to search all moves:
- MovePicker mp = MovePicker(pos, false, ttMove, depth, &ss[ply]);
+ MovePicker mp = MovePicker(pos, false, ttMove, depth, H, &ss[ply]);
Move move, movesSearched[256];
int moveCount = 0;
// Initialize a MovePicker object for the current position, and prepare
// to search the moves. Because the depth is <= 0 here, only captures,
// queen promotions and checks (only if depth == 0) will be generated.
- MovePicker mp = MovePicker(pos, pvNode, ttMove, depth);
+ MovePicker mp = MovePicker(pos, pvNode, ttMove, depth, H);
Move move;
int moveCount = 0;
Bitboard dcCandidates = mp.discovered_check_candidates();
extern int ActiveThreads;
extern Lock SMPLock;
-// Perhaps better to make H local, and pass as parameter to MovePicker?
-extern History H;
-
////
//// Prototypes