Rewrite Position::from_fen()

Complete rewrite the function and extend compatibility
also to X-FEN notation for Chess960.

We are now able to read standard FEN, Shredder-FEN and X-FEN.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2010-07-23 10:38:19 +02:00
parent 098ac5e44e
commit 839088205e
4 changed files with 146 additions and 112 deletions

View File

@@ -404,7 +404,7 @@ Key EndgameFunctions::buildKey(const string& keyCode) {
s << char(upcase ? toupper(keyCode[i]) : tolower(keyCode[i]));
}
s << 8 - keyCode.length() << "/8/8/8/8/8/8/8 w -";
s << 8 - keyCode.length() << "/8/8/8/8/8/8/8 w - -";
return Position(s.str(), 0).get_material_key();
}