projects
/
fairystockfish.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
916c0cb
)
Parse halfmove clock and fullmove number from FEN
author
Joona Kiiski
<joona.kiiski@gmail.com>
Thu, 6 Jan 2011 10:13:28 +0000 (12:13 +0200)
committer
Marco Costalba
<mcostalba@gmail.com>
Thu, 6 Jan 2011 12:44:11 +0000 (13:44 +0100)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/position.cpp
patch
|
blob
|
history
diff --git
a/src/position.cpp
b/src/position.cpp
index
cf2c7ba
..
71556a5
100644
(file)
--- a/
src/position.cpp
+++ b/
src/position.cpp
@@
-264,7
+264,15
@@
void Position::from_fen(const string& fen, bool c960) {
st->epSquare = fenEpSquare;
}
- // 5-6. Halfmove clock and fullmove number are not parsed
+ // 5. Halfmove clock
+ int hmc;
+ if (ss >> hmc)
+ st->rule50 = hmc;
+
+ // 6. Fullmove number
+ int fmn;
+ if (ss >> fmn)
+ startPosPlyCounter = (fmn - 1) * 2 + int(sideToMove == BLACK);
// Various initialisations
castleRightsMask[make_square(initialKFile, RANK_1)] ^= WHITE_OO | WHITE_OOO;