Chess programming and basic chess principles: Episode 1 – The center


How can a computer think better when playing chess?

The raw power of computing alone does not suffice. No matter how powerful a computer is, it will never manage to compute to the depth needed to play a perfect game – at least with the current technological capabilities of human kind.

So we need to make our chess engine ‘think’ and play based on some principles that, if followed, can make the computing of all possible outcomes redundant.

This series of articles intends to discuss those principles and offer insights on how they might be used when coding a chess program.

Chess Principle 1: The center

In the beginning of the game (i.e. in the opening) the players need to strive to control the center of the chessboard.

Of course there are exceptions to that rule. Many meta-modern openings for example, like Pirc, aim at exactly the opposite. However if we are to state a general principle that a relatively solid player (or chess program) should follow is that the more we control the center in the beginning of the game the better.

As the above image shows, a position where we control the center is highly favorable. So an easy way to make the computer play good chess – even without an opening book – is to make the computer add a ‘bonus’ for every square we control at the center or for every piece we have at the center.

[pseudo-code start]
IF Square controlled by computer in Center THEN Increase Score
IF Piece of computer FOUND in Center THEN Increase Score
[pseudo-code end]

This bonus is usually added in the chessboard evaluation function that evaluates the positions considered by the computer.

Next episode: Avoid redundant moves in the opening


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: