Unify move generation

Functional change due only to moves reorder. Anyhow after
5242 games at 15"+0.1 TC verified we have no regression.

Mod vs Orig 994 - 958 - 3290 +2 ELO

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2011-01-07 16:56:42 +01:00
parent 12f4bbc8f2
commit 57b3ca916f
7 changed files with 92 additions and 109 deletions
+2 -2
View File
@@ -149,7 +149,7 @@ Move move_from_san(const Position& pos, const string& movestr) {
int matches, state = START;
// Generate all legal moves for the given position
last = generate_moves(pos, mlist);
last = generate<MV_LEGAL>(pos, mlist);
// Castling moves
if (movestr == "O-O-O" || movestr == "O-O-O+")
@@ -377,7 +377,7 @@ namespace {
return AMBIGUITY_NONE;
// Collect all legal moves of piece 'pc' with destination 'to'
last = generate_moves(pos, mlist);
last = generate<MV_LEGAL>(pos, mlist);
for (MoveStack* cur = mlist; cur != last; cur++)
if (move_to(cur->move) == to && pos.piece_on(move_from(cur->move)) == pc)
candidates[matches++] = cur->move;