How does chess engines work ?

372 views

I know there’s different depths but I don’t know what any of it means.

In: 0

8 Answers

Anonymous 0 Comments

It’s better explain through a game of Tic-Tac-Toe.

So imagine a game of 3×3 TTT. You vs the Computer. The computer starts.

It has 9 possible moves. After each of these moves, it’s your turn, and you have 8 possible moves. After you played, the computer has 7 possibles moves, etc etc…

What a game computer does is list every one of those moves, until it reaches the end of the game. The end is either a draw, a computer win, or a computer loss.

Now assign a score to each state, based on how favorable it is to the computer. If it has 2 X and a Blank in a row, it’s very good, if you have to O and a Blank in a row, it’s bad. If on the next move it fills your Blank, it’s good. A win is VERY GOOD, a loss is VERY BAD.

So each state has a score assigned, and the computer will, at each move, try to maximize next step’s score, while taking into account that you will in turn try to maximize yours. This way, the computer plots an optimal path to a win.

For Tic Tac Toe it’s easy. There aren’t that many different states, and it’s easy to assign a score based on the state of the board.

For Chess it’s the same thing, except instead of plotting in advance every move up to the final state (we can’t store that much information), it will do so for the next *n* move (n being 2, 5, 10,… Chess masters can see so far as 5 moves in advance. Think of how amazing this is considering every possibility).

The main difficulty when creating those programs is finding what constitutes a good state and what’s a bad state.

You are viewing 1 out of 8 answers, click here to view all answers.