I want to evaluate positions statically. So I've written a code which evaluates from a FEN string.

However it is a tedious to copy FEN and then paste for a complete game. So I wanted to know if it is possible to write such a code which can run with WinBoard and which could evaluate the current position statically.

It does not need to generate moves,be able to play a game, deep evaluation ,quiescent search etc.

I'm also not interested in performing King Safety/Mate Threats.

So the program should just give me only a number as output when loaded in WinBoard.

Is there a simple way to perform such a task or a simple enough engine I can modify to do this?

2 Answers 2


Why can't you just make a Winboard chess engine, but evaluate a position statically??

You will need to follow the Winboard protocol:


Although everybody uses alpha-beta/nega-max pruning, but Winboard doesn't know your code. All you need to do is just give an evaluation score from your static function.

Your "engine" will wait for the go Winboard command. Print thinking output like:

ply score time nodes pv

where score will be your static evaluation score. Your engine doesn't need to make a move, Winboard will wait forever for a move. You can always setup a new position in Winboard.

  • Sorry but I'm unfamiliar with the Winboard protocol. Is there a better tutorial on how I can use it?
    – A. Napster
    Commented Sep 12, 2017 at 17:21
  • 1
    chessprogramming.wikispaces.com/UCI explains how to interface with winboard and has a link to the old manual. Commented Sep 13, 2017 at 5:26
  • @A.Napster Fred Knight's links is good.
    – SmallChess
    Commented Sep 14, 2017 at 0:47

The easiest way to accomplish the goal is to download Winboard with its own engine. The GUI can be set to output the current evaluation. You can recode the eval function to your own parameters.

http://chessprogramming.wikispaces.com/Evaluation provides some resources about programming the eval function. However, getting a well-documented source code for the eval function I find easier. Avoid the higher engines like Crafty, but a simple one like http://www.tckerrigan.com/Chess/TSCP/ is easy to understand.

Winboard is the best option, but you can create your own interface. You could modify a PGN viewer to return an eval after every move or put the FENs into a PGN file and loop through all games. You could download https://www-lucaschess.rhcloud.com/ or another chess interface which can analyse a game and use its output.

For the actual question, the chess eval is broken up into many factors.

The easiest is material: just loop over the board and count the material.

Next is pawn structure. Assign a penalty to isolated and doubled pawns. A bonus for passed pawns. (Pawns near the king is under king threats.) This can be modified further by changing the penalty based on the distance from the center.

Next is the pieces in relation to the pawns. A bonus for a rook on a open or half-open file. A bonus for a bishop which isn't trapped behind its own pawns.

Next is the pieces in relation to the center. The closer to the center the piece is, the more it is worth. This also includes a bonus for a rook on the seventh rank. (Trapping the king would improve this score, but this would fall under king safety.)

There is a bonus for having a bishop pair and the values of the minor pieces (the bishops and the knights) are adjusted based upon how closed the center is. A bonus can be added for more mobility (either absolute or for each piece) and/or space control. (Concentrated force(s) is a factor normally reserved for mating threats.)

This is a short list.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.