chessops
chessops copied to clipboard
Add `plyToTurn` util function
It's defined in three different places in lila.
Looks a bit strange to me. Generally halfmove/ply is 0 based. And same in lila, for example on the analysis board:
{"treeParts":[{"ply":0,"fen":"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"}], ...}
But somehow in all these contexts lila uses 1-based ply? :thinking:
It could be a historical mistake that has been copied over and over? I haven’t checked back but it seemed only used for user facing information
Sorry, just noticed the PR is still hanging here. It seems to be working out fine in lila, but still a bit unusual method of counting.