The two loveliest things in my life are programming and chess playing. Because
of my addiction to both, it was always my dream to come out with the development
of a Chess software. Chess programming is not a new thing but it needs an extreme
level of programming and extra-ordinary understanding capacity.
The computer chess has been proved a boon in the field of Artificial Intelligence (AI). Like most AI problems, chess requires a program which will display seemingly intelligent behavior in a limited, artificial world. Unlike most AI problems, the programmers do not get to make up the rules of this world. In addition, there is a very rigorous procedure to test the intelligence of chess program-playing games against humans. Computer chess is one area where the usually disparate worlds of Artificial Intelligence and high-performance computing meet.
My chess software “Brain” is just the basic step to explore this level of programming in C language and reveal many hidden incredible facts and features of C language. This software cannot compete with the world class chess players but it can provide a strong opponent in chess. More over it also teaches a lot of things about chess. This software has been designed and developed completely in C language and compiled in Turbo C++ IDE compiler but its Graphical User Interface gives you the feeling of friendly environment. All the features like pull-down menus and pop-up menus have been designed and developed by me. All the features of this software will be discussed separately. Suggestions for improvement of the software are always welcome.
Brain is a Chess playing software designed and developed completely in C language using graphics and compiled in Turboo C++ IDE compiler. It took around six months to complete this software.
This is the snapshot of the game developed by me. It not only plays game but also gives useful information about chess. The game can be played in any of the following way: Between two Humans, Human vs Computer, Computer vs Human. Facility to take back the move and to get the hint has also been provided.
To represent the chess board, I have used 12x12 array so that I don't need to check the boundary conditions for each piece. All the pieces designed here are just the combinations of basic geometrical shapes like part of ellipses, circles etc. You can also change the look and colour of the pieces and the board.
The game also stores all the move and can display the move list in the right side of the screen in any of the three notation. i.e, International Notation, Algebraic Notation and Coordinate Notation.
For the computer's play, I have used a combination of minimax search tree and alpha-beta pruning as an Artificial Intelligence. For each move of the opponent, first of all, computer generates all the valid moves. Then, for each move, profit and loss is being calculated according to the points given to the pieces and pawns. As per the common convention, I have assigned 9 points to Queen, 5 points to Rooks, 3 points to Bishops and Knights and 1 point to all the pawns. I have also implemented special moves like en-passent rule, castling and pwan promotion.
Well, whatever has been discussed here is just the tip of the ice-burg. Its all about the 16,000 lines of C code and six months of effort in my third year of engineering. Hoping that you will appreciate it very well. Any suggession/ comment or feedback to improve the game is always welcome.