How to write a simple chess engine to statically evaluate a position? 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?
Why can't you just make a Winboard chess engine, but evaluate a position statically??

You will need to follow the Winboard protocol:


  https://www.gnu.org/software/xboard/engine-intf.html


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.