This ties in with an above comment on piece codes/ values from Bob, which I quote for conveniencemetax wrote:I would be surprised if not. As far as I know, Crafty uses MVV/LVA to order captures and this information is useful to do so.Fguy64 wrote:So do you use the stored info for moved piece and captured piece for subsequent move ordering calculations then?
In my old system, my piece codes were also piece values, which made for efficient calculation of material balance and MVV/LVA sorting. But this has limitations, so I am looking at storing piece symbols in my position, and of course also an efficient way of looking up material values.bob wrote: ...
You can do the same thing with p=1, n=2, b=3, r=4, q=5, k=6, and a small array pv[6] = {100 300 300 500 900 99999}; Then index into this array using the piece type to get the score.
I like the 'small array' system quoted above. But a cornerstone of my square-centric engine is that in the position array, black pieces are negative numbers and white pieces are positive. And I use this difference to determine whether a piece is capturable as I am traversing the array. And then there is the issue of a -ve number can't be used as an array index. Other forms of lookups in java seem very slow, so I'm kind of scratching my head.