Sep 01 2009

The Knight’s Tour

Game loads below this line...

The knight’s tour is an ancient puzzle, the object of which is to visit every square on a chessboard exactly once with a knight. It’s a somewhat famous puzzle because it was performed by the Mechanical Turk, and is used as an example in various computer science courses. There are two types of tour, Open and Closed. In a Closed tour, the knight returns to the first square it started from. In an Open tour it does not. The game calculates a score based on how long you took, and a multiplier based on the type of tour you complete.

You may play here or on Whirled. (The Whirled version will give you a trophy for completing either type of tour.) Depending on how much chess you may have played, you may find this puzzle difficult or extremely easy.

Except for the dialog boxes, this project was complete last week, and I had planned to finish it this past weekend. However, that got interrupted by Ludum Dare. I spent yesterday and this morning finishing the dialogs and implementing the Whirled API. Although this project itself wasn’t very involved… I did come out of it with a Chess Board class which is able to check moves to determine if they’re valid (for knights– but it’s easily extendable to any piece). There are a number of directions to go from there if I choose to.

The Whirled version was the first released to the world this time, as I did the implementation in the time it took for Mochi to approve the game for advertising. I had no major issues with the API implementation, everything was straight forward and as described in their wiki page about porting a single playing gameor was cribbable from Barnstormer’s Whirled edition.

Probably my having been working on a game involving a chessboard contributed to my building a grid based game during the Ludum Dare competition.

That clears my deck of small projects. The ones remaining are more ambitious, so I wouldn’t get too excited by my recent frequent blogging. As always, comments appreciated.

*-Here┬áis a link to the wikipedia article on the Mechanical Turk referenced above. It contains a solution to the puzzle, so I didn’t want to link it off my front page, but you may wish to reference it if you’re interested in the problem or if you’re stumped.

1 Comment

  • By A.J. Fox, May 8, 2011 @ 11:49 am

    I played this years ago on a chess board but kept getting lost as to which squares i had done! The gane is too addictive lol

Other Links to this Post

RSS feed for comments on this post. TrackBack URI

Leave a comment