In the previous episode we set the foundations for starting a chess program. In summary we…
- Discussed the pre-requisites for the tutorial
- Created the chessboard
- Got the first input from the user
Now it is time to start the design of the chess thinking algorithm.
Step 0: Design the main steps on paper
Before making any serious programming attempt, one has to leave the computer and get a piece of paper. There, he can design the algorithm of the program. A good design is invaluable for a good program. There is no need to start writing code without having that design first!
One can find above a rough outline of the major steps involved in a chess program algorithm.
Note that this algorithm is an over-simplification, but it will do for now. For example, the algorithm above does not take into account the fact that the thinking of the computer must be conducted in various depths and not only in the initial position. We will elaborate on that in next episodes; for now let us just try to analyze all possible moves in a position and choose the one that leads to the best score.
[Next episode: Scanning the chessboard for moves]