Programming Resources
For Fun and Learning
Charles Cusack
Computer Science
Hope College
main

Python
C++

JAVA


PHP
SQL
Alice

KnightTour


Description

Run it
Download jar file (Right click)

ChessBoard.java
KnightTour.java
KnightTourApplet.java

Description
KnightTour is a simple applet that can:
  • Try to find a knight tour of an n by n chess board by trying randomly for a while.
  • Try to find a knight tour of an n by n chess board by trying all possibilities. This uses a backtracking algorithm.

The main purpose of the applet is to demonstrate a recursive backtracking algorithm, but also to:

  • Serve as a simple example using arrays.
  • Serve as a simple example of a writing and using a class.
  • Serve as a simple example of using swing comonents.
  • Serve as a simple example of using a layout manager.
  • Serve as a simple example of simple event handling.

The jar file is executable, and contains BlueJ project files.