bishops: Gentle Bishops Puzzle Solver


This is a program to compute solutions to the bishops puzzle, which I first saw in the computer game "7th Guest". It was originally called "A New Bishops Puzzle", and was created in 1917 by H. E. Dudeney. I've since seen Java applet versions of this puzzle online under the name "Gentle Bishops".

The puzzle involves eight chess bishops, four each of white and black, initially lined up at the opposing ends of a five-by-four board. The objective is to exchange the positions of the bishops by a series of legal chess moves, such that at no time is any of the bishops threatened by another.

The program solves the puzzle by a brute force search. It only actually has to solve half of the problem, because chess bishops never can move to a square of a different color than they started from. Thus the bishops initially on black squares can be exchanged by a mirror image of the moves used to exchange the bishops initially on white squares.

It may have taken me longer to write and debug this program than it would have taken to come up with a solution on my own. However, the program is able to find the optimal solutions (18 moves per color), which I probably would not have found. In fact, the solution offered by the publisher of "7th Guest" was not one of the optimal solutions.


bishops is distributed under the terms of the Free Software Foundation's General Public License, Version 2. If you agree to the terms of the license, you may download it.

Download bishops-0.2.tar.gz ( 10K, Sunday, 01-Feb-2004 19:42:13 MST)

bishops development uses the Subversion revision control system. Instructions for access to the Subversion repository for bishops are found at, and there is a web interface to browse the repository at

Last updated February 24, 2004

Copyright 2004 Eric Smith

Best Viewed With Any Browser Valid HTML 4.01! Valid CSS!

check now

check now