Write a revised version of the Knight's Tour program using this accessibility strategy. In determining the next move, the knight should move to an available square with the lowest accessibility value. In the case of a tie, you can move the knight to any of the tied squares.
The original accessibility information is stored in an 8-line text file named access.txt. Each line consists of the 8 accessibility numbers for that line, separated by blank spaces, terminated with the enter key. You should read this data file to set up your starting accessibility data table. It would be a good idea to test your initialization of the accessibility table.
To ensure a greater degree of success, as the knight moves around the board, you should reduce the accessibility numbers in the appropriate squares. For example, if location[4][5]
is visited, then the 8 squares that can be reached from location[4][5]
should have their accessibility values reduced by 1.
Proper decomposition of the problem into single-purpose methods will be of great importance in this lab assignment.
Turn in your source code and a run output with the highest number of visited squares.