pleco-rs / Pleco

A Rust-based re-write of the Stockfish Chess Engine

Home Page:https://crates.io/crates/pleco

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Midgame centipawn conversion is off

nicholasfagan opened this issue · comments

There's likely a typo in the conversion of values to centipawns.
Line 76 has self.mg() / PAWN_EG, where it should likely be self.mg() / PAWN_MG.

/// Gives the value of the score in centi-pawns
pub fn centipawns(self) -> (f64, f64) {
let mg: f64 = self.mg() as f64 / PAWN_EG as f64;
let eg: f64 = self.eg() as f64 / PAWN_EG as f64;
(mg, eg)
}

@nicholasfagan Thanks so much for raising this issue! Has just been fixed in PR: #150