How to develop a chess program from scratch (for total beginners) Ep. 2

Huo Chess (console edition)

[Previous episode]

Overview

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!

Chess program algorithm outline

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]

[Previous episode]

3 responses to “How to develop a chess program from scratch (for total beginners) Ep. 2”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: