4 ms·
I haven't played it yet, but I am curious, the variable pst seems to give the score of a piece given the square it is, independently of the position? How it tha
by S4M 12y ago
I haven't played it yet, but I am curious, the variable pst seems to give the score of a piece given the square it is, independently of the position? How it that possible, am I missing something? (You only use pst to calculate the score of a move, if there is no check, checkmates or capture).
Having said that, the code is very neat and readable. Thank you for showing it here!
- someotheridiot 12y agoCorrect, that's what it is doing. It is a very fast and surprisingly strong way of evaluating the position. Of course stronger engines do a hell of a lot more than this and gives weightings based on the positions of other pieces, but most of them have something like this as a baseline.
- halfcat 12y agoPST stand for piece-square-table. You keep the static evaluation simple and fast, and let the search hash out the dynamic details. The search is surprising effective at its job, and trying to evaluate a position statically is surprisingly difficult.
- thomasahle 12y agoExactly! Indeed some engines (the Micro-Max engine) just tries to move all pieces towards the center, and it still works pretty well! (http://home.hccnet.nl/h.g.muller/pcsqr.html http://home.hccnet.nl/h.g.muller/pcsqr.html) I wanted to add the table though, as I thought it made the games more interesting, and gave a nice handle on tweaking the engine.