# Algorithms to score chess moves [duplicate]

How to score a chess move, which techniques are used to figure out how good a move is?

• I'm sure this is a duplicate. – SmallChess Jul 21 '18 at 12:48
• @SmallChess with your 12k reputation you must know what to do, 1) search for the duplicate, 2) copy the URL, 3) press `close` 4) choose `duplicate` 5) paste URL into the edit box, 6) push the button... etc. =) – lenik Jul 22 '18 at 1:03

Firstly, I would like to point out, you cannot figure out how good is the move, because no move can improve position, only make it worse. And the winner is usually the one who managed to "destroy" his position less than the opponent. So the questions should be: "how bad a move is"... =)

Secondly, I believe you cannot actually `score` a move. You can only score the original position and the resulting position and subtract the former from the latter to find out how worse it became.

The position evaluation is quite big and complicated topic by itself. There are two ways -- static evaluation, when you just add up all pieces and some extra points for open lines, centered pawns and other things considered to be "good", and dynamic evaluation, when you start building a move tree, as far as you could, statically evaluate positions after a few moves and use min/max to derive the evaluation for the current position.

If you are interested, there are quite a few open source chess engines, starting from 100 lines of code, written in C, C++, Python and other languages, so you may easily choose the one you like and see how it works, maybe change a few lines and see what happens.

• I mean a chess player want to know which move to perform if he wants to keep playing that is why he searches for the best move – Fuel Jul 21 '18 at 13:51
• @EugenioUllauri do you want to talk about the chess engines or the train of thought in the head of human player, when choosing the next move? – lenik Jul 22 '18 at 1:05
• About any system that wants to win and has to do a move so obviously wants to know the best movr – Fuel Jul 22 '18 at 18:16

Initially the score based on a piece square value, which tends to centralize the pieces and give a bonus for castling. Some elements can add additional bonuses--such as, a capture, a check, or other forcing move. This value is how moves are sorted to be used by the search function.

The search function plays moves until a certain value is reached; be it a certain depth, score, or elapsed time. The final position is normally a quiet one to get a more reliable evaluation. This final score is added up by such elements as material, pawn structure, king tropism, space...

By looking at computer chess codes, this was the standard algorithms used to calculate moves, but with the success of AlphaZero, there is more of what we call intuition used.