Frequently Asked Questions about playing chess against tkChess

Here are answers to some of the more common questions about the tkChess program. If you have any other questions about the program, you should always feel free to send me email; my address is at the bottom of this page.

Start a new game.

Who is playing against me?

You are playing against my computer, running a chess-playing program through its web server.

What are those strange-looking links with names like e4 or Nf3?

The tkChess script provides you with a set of links for making moves. These links are labeled in what is known as algebraic notation. In algebraic notation, every square on the chessboard gets a name consisting of a letter indicating its file (column) and a number indicating its rank (row). The files are given the letters a through h running from left to right, and the ranks are given the letters 1 through 8 with the lower numbers at the bottom of the board. For example, the lower left-hand corner of the board is a1, the upper right-hand corner is h8, the starting position of the white king is e1, and the starting position of the black queen is d8.

Moves are indicated by giving a piece name (R = rook, N = knight, B = bishop, Q = queen, K = king) followed by the square to move it to. For example, from the opening position Nf3 will move white's king's knight to square f3 (two squares in front of the king's bishop). If no piece name is given, it's a pawn move: for example, e4 is a very common opening move for white. Captures are indicated by putting an x between the piece name and its target square (Nxf6). For a pawn capture, the starting file of the pawn is given instead of a piece name (e.g., dxe5).

If there is more than one piece of the same type that can make a move to a particular square, enough information about the starting square is added to the piece name to remove the ambiguity. For example: if there are knights on c3 and g1, and both can move to e2, then the c3 knight's move is written as Nce2 and the g1 knight's move is written as Nge2.

The only moves that are not covered by this system are castling moves. These are written as O-O for king's-side castling and O-O-O for queen's-side castling.

This system may appear complicated at first, but it becomes easier with a bit of practice. Remember that you can always try out a move that you're not sure about just by clicking on it. If you want to take the move back, you can usually just go back a page using the back button on your Web browser.

The program locked up for 3 days without moving. What gives?

This seems to happen with the Java interface sometimes. Usually it's a sign that the network connection timed out. Unfortunately, the Java applet does not recover gracefully from this. If you find it happening a lot, you may wish to switch to the original interface.

There's a bug in tkChess that makes it play illegal moves or reject my legal moves.

TkChess is pretty good about playing legal chess, and often what appear to be bugs are situations where the move you want to make is in fact illegal (e.g., because it exposes your king to check, leaves your king in check, or violates the restrictions on castling or en passant captures). If you can send me the position the board was in when the problem occurred, I can try to figure out what went wrong. You may also want to check out some of the more obscure details of the official Laws of Chess, published by the World Chess Federation (FIDE).

I tried moving a pawn from c2 to c4 and the computer took it on c3!

This is an en passant capture. From the FIDE Laws of Chess:

3.7.d. A pawn attacking a square crossed by an opponent's pawn which has advanced two squares in one move from its original square may capture this opponent's pawn as though the latter had been moved only one square. This capture is only legal on the move following this advance and is called an 'en passant' capture.

What does (Value: 104 Depth: 3) mean?

The value number is a measure of how well tkChess thinks it's doing. The scale is roughly 1 pawn = 100 points. If the number is positive, tkChess thinks it's winning (it may well be mistaken). The depth number is how many moves ahead tkChess searches under normal conditions. Unless the program changes it should always be 3.

What is tkChess's rating?

Short answer: it doesn't have one. Some time ago a program running the same search engine at a slightly lower depth setting had a rating for blitz games of about 1700 on the Internet Chess Server (which is now the commercialized Internet Chess Club). But this rating was largely based on winning games on time; the program has essentially no endgame heuristics and rarely manages to checkmate a careful player.

My cousin Judit could beat this program with her eyes closed. Why is it so weak?

There are a couple of reasons for this. The main one is that tkChess is not really a serious chess program; its static evaluator is very limited (and mostly stolen from GNU Chess, but that's another story), and it has a poor understanding of endgames.

The second reason is that tkChess's search depth is set very low. Currently it only searches to 4 plies under most circumstances (it can search deeper in response to checks or captures). This just isn't deep enough to play strong chess.

I don't have a cousin Judit. How come tkChess always wins?

TkChess, like other computer chess programs, does a thorough search of all possible moves and replies out to its search depth. So it doesn't miss much that fits within its horizon. If you leave a piece undefended, it will notice and take it. If there is a simple combination of moves that wins it material or the game, it will find it. Unlike many human players, tkChess punishes mistakes ruthlessly.

If you are losing to tkChess a lot there are two things you could try. One is to make heavy use of the back button. TkChess is just a computer program and it doesn't care if you take back moves. Another is to study up on chess tactics. This page has a nice collection of handouts on recognizing tactical opportunities (and avoiding letting your opponent get them).

How do I change the default search depth?

Sadly, increasing the search depth would mean that my poor little workstation would be spending all of its time playing chess and would leave me with very few CPU cycles to do important things like write FAQ pages. So you can't increase the default search depth. On the other hand, decreasing the default search depth would make tkChess play very badly. So you can't do that either.

How come switching sides flips the board in the Java interface?

This was a much-requested feature that I never got around to writing myself. But Brian Hamm was kind enough to provide a patch to the applet code to do this, so now it's the standard behavior in both the regular and Java interfaces.

My company/group/cousin has an exciting chess-related web page that could really use a higher PageRank, can you link to it?

No. Almost all the requests I get for this are clearly spam, so it's easiest for me to ignore all of them. Most likely I will not even bother to respond to your email.

Can I run your Java applet on my server?

Probably not. Even if you copy the Java class files, you still need to be able to compile and install the server-based CGI program that actually selects the computer's moves. This has proved surprisingly difficult for the various people who have tried to do this.

However, if you are:

then you can download the source distribution in either GZIP compressed tar format or Zip format.

I tried connecting to FICS, but it doesn't work

There are two things that typically happen here:

Nothing happens or I get an error message

Either FICS is down, or your software is broken.

I get a connection, and it says:

UNIX(r) System V Release 4.0 (polaris)


Your software is definitely broken; it's trying to connect to the default telnet port 23 instead of port 5000. You should have a chat with whoever installed, sold, or otherwise supplied your WWW browser to see about getting this fixed.

Can you help me fix my broken software?


Why did you write this?

I wrote a core set of chess move generating and parsing routines in C some time ago as a side-effect of ICS commercialization politics. The search engine was put in to test the move generator. Later, I added Tcl/Tk support because I thought it might be fun to have a whizzier ICS client than xboard. When I realized that you can't have a whizzier ICS client than xboard, I put together the web page. So you are playing against software that's been recycled twice!

Jim Aspnes <>