I am currently using a triangular array to collect the PV in my chess engine (written in C). However, I would like to return several variations such as the second best, third best, and so fourth. Is is possible to do with a triangular array scheme or do I need to use a transposition table. In either case is there a simple example of an engine that uses; one preferably in C?
1 Answer
You use neither.
You run your search to collect the best PV from your triangular table. This gives you your best variation. Then you exclude this best move and run another search to get the best PV from your triangular table. This gives you your second best variation. And so on.
-
This is a nice idea. I could also add a line to the evaluation function that punishes the last variation returned. I havn't implemented yet but this answer should work until I feel like implementing a TT.– nak3cCommented Feb 13, 2017 at 14:31