The computer uses a thing called "minimax", where it looks at each possible move, and calculates a "score" for black and white. It tries to leave the human with the worst possible set of moves, and assumes that the human will try to leave it the worst set of moves. to calculate what the human's move will be, it uses minimax.. The computer has to stop at some number of moves in the future, so it may look ahead 3 moves, or more for harder computer opponent. The number of moves it looks ahead is called "depth". The depth is how far ahead minimax can see.
So the computer plays a bunch of games in it's head, finding the one that it thinks the hardest for the human to win.
Chat with our AI personalities