MadChess 3.0 Beta 6794c89 (King Safety)
I added evaluation of king safety to MadChess 3.0 Beta. Because determining the safety of a king’s position involves examining moves that attack squares near the king, I combined it with piece mobility evaluation, which also examines moves. When examining piece mobility, keep a weighted count of attacks on squares ringing the king (16 squares in outer ring and 8 squares in inner ring) with separate weights for attacks by minor pieces, rooks, and queens. In the following code, white moves to squares ringing the black king contribute negatively to black’s king safety. Black moves to squares ringing the white… Continue Reading