How do you go about writing an evaluation function for a bitboard bases chess engine? I want to start of simple and only evaluate based on piece value, and where the pieces stand. For example a knight on c3 should give more points than a knight on a3.
I can start with making an array of size 64 for each piece with weights. For example I can store the value 0.1 in the square c3 and -0.1 in the square a3 for the knights. Then I could loop over the 64 squares and check if any of the 12 piece types are in this square and add (or subtract) it from the total evaluation. However it seems like this is very slow.
If I were only counting the piece values then I could use a pop count on each bitboard to get the value, but I don't see how I can implement the square weights this way.
Is there a smarter way to think about this?