Forums

How logic are used by chess players

Sort:
Bikass

Generating chess moves
As we discussed last time, the algorithm used to identify the best move into a specific square is fairly simple. The logic examines all the possible attacks by enemy pieces into the square. We saw how the best move value could be determined by looking at all possible attacks and selecting the one from the lowest value piece as our best option.

 

One thing we didn't discuss was how the attack signals are to be generated. The diagram below illustrates how the attack signals can be generated from the value of the piece in the square. For example, if the piece is a king (K), the attack signals going to the squares above, below, to the left, to the right, and diagonal to it are activated. If the piece is a knight (N), only the attack signals going to the knight's possible destinations (up two and over one, down two and over one, left two and up or down one, and right two and up or down one) are activated.