Build a MiniChess State Evaluator

If you want to do better than random play, you will want to figure out what a good move is. We will say that a good move is one that produces a good state. This is a key idea for making things work.

Write a method for State that gives a value for that state. The value should be an integer between -10000 and 10000: positive numbers indicate an advantage for the side on move, and -10000 (10000) means a sure loss (win). This value is just a heuristic guess, so do not worry too much about whether it is perfect.

The easiest thing to do is to score as in standard chess, with 100 points ("centipawns") per pawn. Give each side 100 points for each of its Pawns, 300 for its Bishop or Knight, 500 for its Rook, and 900 for its Queen. Take the difference between the two sides to get the score.

Once you have a scoring method, change your program to pick a random move that is worst for your opponent (and thus best for you). Make the program calculate the value of the state that your opponent gets for each move you could make in the current position and choose the worst one. (The value of a state is positive when the side on move has the advantage.)

Missed Opportunity: There are many ways to make a better scoring function. For a start, scoring based on piece position would be useful. Also, the values should be tuned.