Page 1 of 1

What are chess bonuses? Saw in my friends program..

Posted: Tue Apr 26, 2022 10:47 pm
by stelugo
Hello everyone! This is my first post and would like to say that I'm new to programming and even newer to chess.
My friend gave me his chess program to tinker with, hes going through a lot of personal things and i did not want to bog him down with questions about
his program, so i decided to turn to this community for you opinions, thoughts, and potential guidance.

SOME DETAILS: in the chess program he has created variables as bit masks to helps extract specific files or ranks from a board. I think it would most likely be used as helper variables in a bit board board representation.

Q: That said, he has 5 different arrays (or lists in this Python program) named PAWN_BONUS and the other 4 are for KNIGHT, BISHOP, KING, and KING_ENDGAME_BONUS.

I wanted to ask, what are these bonuses for you think? I have never really heard about BONUS before in chess, maybe due to my naivety. I did some digging and only found references to "Pairs" but im not sure why this was included and what its purpose is. Below is one of the arrays, for the pawn bonus.

PAWN_BONUS = [0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, -40, -40, 0, 0, 0,
1, 2, 3, -10, -10, 3, 2, 1,
2, 4, 6, 8, 8, 6, 4, 2,
3, 6, 9, 12, 12, 9, 6, 3,
4, 8, 12, 16, 16, 12, 8, 4,
5, 10, 15, 20, 20, 15, 10, 5,
0, 0, 0, 0, 0, 0, 0, 0]

Re: What are chess bonuses? Saw in my friends program..

Posted: Wed Aug 10, 2022 12:42 am
by Dragon-Hatcher
Looks to me to be https://www.chessprogramming.org/Piece-Square_Tables.

The idea is to encourage placement of pieces on adventages squares.
In your example centering and advancing pawns,