/// Variables
- MovePicker::MovegenPhase PhaseTable[32];
+ MovePicker::MovegenPhase PhaseTable[32];
int MainSearchPhaseIndex;
int EvasionsPhaseIndex;
int QsearchWithChecksPhaseIndex;
/// move ordering is at the current node.
MovePicker::MovePicker(const Position& p, bool pvnode, Move ttm, Move mk,
- Move k1, Move k2, Depth d) : pos(p) {
+ Move k1, Move k2, Depth d) : pos(p) {
pvNode = pvnode;
ttMove = ttm;
mateKiller = (mk == ttm)? MOVE_NONE : mk;
break;
case PH_EVASIONS:
- assert(pos.is_check());
+ assert(pos.is_check());
numOfMoves = generate_evasions(pos, moves);
score_evasions();
movesPicked = 0;
break;
- case PH_QCAPTURES:
+ case PH_QCAPTURES:
numOfMoves = generate_captures(pos, moves);
score_qcaptures();
movesPicked = 0;
return MOVE_NONE;
}
}
- assert(false);
- return MOVE_NONE;
}
if (m == MOVE_NONE)
finished = true;
- lock_release(&lock);
+ lock_release(&lock);
return m;
}
}
-/// find_best_index() loops across the moves and returns index of\r
-/// the highest scored one.\r
-\r
-int MovePicker::find_best_index() {\r
-\r
- int bestScore = -10000000, bestIndex = -1;\r
-\r
- for (int i = movesPicked; i < numOfMoves; i++)\r
- if (moves[i].score > bestScore)\r
- {\r
- bestIndex = i;\r
- bestScore = moves[i].score;\r
- }\r
- return bestIndex;\r
+/// find_best_index() loops across the moves and returns index of
+/// the highest scored one.
+
+int MovePicker::find_best_index() {
+
+ int bestScore = -10000000, bestIndex = -1;
+
+ for (int i = movesPicked; i < numOfMoves; i++)
+ if (moves[i].score > bestScore)
+ {
+ bestIndex = i;
+ bestScore = moves[i].score;
+ }
+ return bestIndex;
}
}
-/// MovePicker::current_move_type() returns the type of the just\r
-/// picked next move. It can be used in search to further differentiate\r
+/// MovePicker::current_move_type() returns the type of the just
+/// picked next move. It can be used in search to further differentiate
/// according to the current move type: capture, non capture, escape, etc.
MovePicker::MovegenPhase MovePicker::current_move_type() const {