how do chess engines work?

Sort:
waffllemaster

Inside each computer box is a small chess playing midget who is around master strength.

The midget isn't good enough to beat most professional players, but he's good enough to fool most amateurs, so he continues to sell.

Source: http://en.wikipedia.org/wiki/The_Turk

TheGrobe

Simple explanation is that they have a means of evaluating the value of a given position and can calculate (and evaluate) very quickly a tree of the positions that can be reached from the current one by any sequence of legal moves and choose the line that allows them to arrive at the most favourable position.

There are a number of techniques that refine and improve the efficiency of this process, like pruning, but in a nutshell that's the process.

b3nnyhaha

they simply check every possible sequence of moves in order to find the 'best' one. 

TheGrobe

And yes, many engines rely on opening databases at the beginning of the game and endgame tablebases at the end.

macer75

But they're still bad at endgames?

waffllemaster
macer75 wrote:

But they're still bad at endgames?

When they merely relay the information in the endgame database they're literally perfect.

When they calculate an endgame on their own they're usually pretty bad.

TheGrobe

I suspect that's because in the endgame the tree is very wide (lots of candidate moves to consider) so it is very resource intensive to get very deep, especially given the exponential nature of the move tree.