
https://talkchess.com/forum3/viewtopic.php?p=601942#p601942

N.E.G. 1.0 released

Post by H.G.Muller » Fri Dec 26, 2014 2:25 pm

Just for fun I made a small improvement to my non-searching Chess engine N.E.G.: it had a nasty tendency to draw games where it had reduced the opponent to a bare King, because when there is nothing left to capture it prefers checks, and chasing the bare King with a Queen (which often was the only active piece) of course leads to nothing.

So in this new version it only gets the bonus for checking with a new piece. This usually is enough to get a bare King checkmated.

I also made it WB v2, supporting setboard, and Linux-compatible. This is the source code:

https://talkchess.com/forum3/viewtopic.php?p=601966#p601966

Oops, I already discovered a bug. The 'always promote to Q' line has the colors reversed, and should have read:
CODE: SELECT ALL

	if((board[bestTo] & 7) < 3 && (stm == BLACK ? bestTo < 16 : bestTo > 111)) board[bestTo] |= 7; // always promote to Q
  
As it was, it would never promote its own Pawns, but just leave them as dead wood on the last rank.
