Chenard Web Edition - by Don Cross

Sorry, your browser does not support execution of Java applets, or does not support Java Runtime Environment (JRE) 1.4.2 or greater.

Project Notes

I started this project because I have been wanting to learn how to write Java applets for quite some time. I had already used C++ to write a chess program (called Chenard) for Windows, OS/2 (remember that, anyone?), DOS, and Linux.

[ Project Revision History ]

Instructions

Click on the piece you want to move, then click on the square where you want it to go. If you click on a piece, but decide you don't want to move it after all, just click on a square that would cause an illegal move. An easy way to do this is to click on the same square again. Then click the piece you really do want to move, followed by its destination square.

To castle, first click on your king, then 2 squares to the left or right, depending on whether you want to castle king-side or queen-side. The computer will move the rook around the king for you.

To capture en passant, just move your pawn diagonally forward one square as appropriate. The captured pawn will be removed for you.

To promote a pawn, just move the pawn as usual. The computer will ask you which piece you would like to promote to (queen, rook, bishop, or knight).

It doesn't work!

If the chess program does not appear above in your browser, it probably means you need to download and install the latest version of the Java Runtime Environment (JRE) from Sun Microsystems. This chess program requires JRE 1.4.2 or higher.

Click HERE, then look for the link on that page that says "Download J2SE JRE".

You DO NOT need to download the Software Development Kit (SDK)... it's way too big and has stuff that only programmers need!

Programmer's Corner

If you are interested in the internal workings of this chess applet, one simple thing you can do is take a look at its debug output while it thinks about moves. You can do this by opening the "Java Console". I am using Mozilla Firefox 1.0.5 on Windows XP, with Java Runtime Environment 1.5.0, and I can see a little coffee cup icon in the lower right corner of my screen. When I right-click on it, I see some options. Selecting the "Open Console" option allows me to see debug information like this:

    PATH:  3 [  0.4201 : 13. ... Qc7  14. f4 Ke7  15. Qe2 ]
    PATH:  3 [  0.4701 : 13. ... Rh7  14. h3 Rg7  15. Bh6 ]
    PATH:  3 [  0.4901 : 13. ... Bc6  14. Qf3 Qc7  15. Bf4 ]
    PATH:  3 [  0.5792 : 13. ... c4  14. Qf3 cxb3  15. Bxf6 ]
    PATH:  4 [  0.5194 : 13. ... c4  14. Qf3 Qc7  15. Bf4 Qd8 ]
    PATH:  4 [  0.5782 : 13. ... Rg8  14. Qc1 c4  15. Qf4 cxb3  16. Bxf6 ]
    PATH:  4 [  0.5894 : 13. ... d6  14. Qf3 Nbd7  15. Rfe1 d5 ]
    ChessThinker.think:  think time = 5.058 seconds

Each line beginning with "PATH:" is an expression of what the computer is thinking about the current position. The number to the left of the "[" is how many turns (called plies) into the future the computer was thinking. Note that the computer will go past this search limit to expand out a series of captures. This is called quiescence search.

Inside square brackets is a numeric score that indicates how good or bad the computer thinks the position is. Positive numbers mean that the computer thinks it has an advantage, and negative numbers mean the computer thinks its opponent has an advantage. For example, a score of 1.0000 means the computer thinks it is winning by the equivalent of one pawn. Positional factors are involved in calculating this score, like king safety and pawn structure.

After the score is the predicted line of play, starting with the move that the computer thinks (so far) is its best. After that is the move it expects you will play in reply, and after that its reply back to that move, etc.