January 07, 2007

Programming Challenge Two

I had fun doing last week's challenge, no other solutions sent or linked yet, but there's no timelimit; I'll accept entries indefinitely. Other program notes: I think that I'm going to try to post challenges on Monday, my solutions on Thursdays.

Challenge Two

The Knight's Tour is an old math problem: given a standard chessboard and a single knight, can you move the knight such that you land on every square exactly once. The knight must move as per normal chess rules, you can start and end on any square. A slight variation is a closed tour, where the knight ends up one legal move away from the starting point.

The challenge is to produce a program (in any language) that returns a solution to the puzzle.

None of the following are problem requirements, but worth considering:

Some notes, none of which are promised to be helpful, but have occurred to me as I posed the problem: