
How does chess bots work ?
Hello ! I'm Confitureur ! Today, I'll show you how does a chess bot ! But, I will show it for the easiest way : in type bruteforce. The only problem with that is that a move can be really slow.
How does it works ?
In this position (white to play), you can see that white is totally winning. But, the bot needs to find the best move. To make this work, you need to give conditions, for example : if you take a bishop, +3 points to the move, if your opponent can take your queen, -9 points to the move, if you have a pawn in the center, +3 points to the move..... And the move that has the most points is played ! For example, in this position, the best move is to take the queen. So the bot will play it. And the more moves you predict, the best the bot will be.
But, there's still a problem, it's too slow. If you don't want to make a nasa chess bot, you can use a technique. It consists to say : if the first move makes you lose, for example, your queen. It will be bad so we don't look at the moves after.
Here, the "depth = 20" means that stockfish predicts 20 moves in the future.
And for other bots ?
So, I'm sure you have this question, how does bad bots work ?
Martin
To make Martin bad, I THINK that chess.com make it see one moves in the future, if there is no mate in 1 (because Martin is programmed to not miss mate in 1), Martin plays a move seeing 1 move in the future or a random one. I think that.
Worstfish
Do you know worstfish ? It's a bot which does everything to lose. So, after what you learned, how do you think it works ?
You guessed it, it calculates the points and play the move with the least points.
End
So, this blog is finished. I hope you liked it and learned something !
Bye,
Confitureur