Group Page

Echo Bots

Mirror Chess

Home Page

A Minimalist Chess Variant Playing Program

Try the program at woomerang.com

I am interested in minimalist solutions to problems in Artificial Intelligence. Here I apply what might be called the echo principle to solve a simple problem in computer chess.

Computer Chess

Computer chess has been a 'gold standard' problem in Artificial Intelligence since the work of Turing and Shannon in 1950 [1]. Such has been the success in this area that freely available chess programs can now beat all but the very best human players. Perhaps computer chess has even been a victim of its own success, as few people would now claim that a machine requires real intelligence to play chess.

Mirror Chess

There are many variants on the standard game of chess. In mirror chess, Black always moves so as to reflect White's last move, as if in a mirror. White attempts to play in such a way as to avoid breaking the mirror symmetry [2][3].

The Mirror Chess Program

A minimalist program to play mirror chess is shown in Listing 1. The program plays with the black pieces. Numerical rather than standard chess notation is used for convenience of programming. White's move is entered as coordinates x1,y1 of the piece to be moved followed by coordinates x2,y2 of the destination square. Black's answering move is printed using the same notation. The program works by simply echoing the input move back as an output move after applying a reflection in the y-axis.

Listing 1. Mirror Chess Program

do
input x1,y1,x2,y2
print x1;9-y1;x2;9-y2
loop

Example Game

Part of a game is shown in Listing 2. The position on the chess board is shown in Picture 1.

Listing 2. Example Game

>run
? 5,2,5,4
5 7 5 5
? 7,1,6,3
7 8 6 6
? 6,1,3,4
6 8 3 5
? 4,2,4,4
4 7 4 5
? 6,3,7,5
6 6 7 4
? 4,4,5,5
4 5 5 4

image

Picture 1. Position on the Chess Board

GNU chess [4] is licensed under the GNU General Public License, Version 2.

Conclusion

Finding minimalist solutions to problems in Artificial Intelligence can sometimes be instructive. By applying what might be called the echo principle, a minimalist program for the computer chess variant of Mirror chess playing with the black pieces has been demonstrated. The construction of a program to play mirror chess with the white pieces is left as an exercise for the reader.

References

[1] A Short History of Computer chess

[2] Playing Chess Against Its Mirror Image

[3] A "Mirror" Chess Problem

[4] GNU chess

About the Author

Jeremy Gardiner is a physicist who has been working in software engineering for 20 years. He loses against chess machines in his spare time.

Contact the author: jeremy@woomerang.com

Copyright © 2005 J. C. Gardiner. All rights reserved.