Evaluating chess game state using Fairy Stockfish and Node

Viewed 261

I am using the ffish npm library which uses Fairy Stockfish, a version of the Stockfish engine. I am able to create a board

let board = new ffish.Board('chess');

and set it up via PGN.

const game = ffish.readGamePGN(pgn);
const moves = game.mainlineMoves().split(' ');
moves.forEach(move => {
  board.push(move);
});

All of this works well, but I want to get the evaluation of the current game state. I am new to chess, so I believe it is also called WDL, but I am not sure. I want to get the evaluation number that is positive if white is expected to win and negative if black is expected to win based on the current game state.

I have looked through the documentation for both ffish and Fairy Stockfish, but I cannot figure out a way to do this. Looking at working examples using Fairy Stockfish, I have seen that you can in fact get this rating somehow, though I cannot find out the way to do it.

0 Answers
Related