Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Knights Tour ( Knight\'s Tour ) One of the more interesting puzzlers for chess b

ID: 2247425 • Letter: K

Question

Knights Tour

( Knight's Tour ) One of the more interesting puzzlers for chess buffs is the Knight's Tour problem. The question is this: Can the chess piece called the knight move around an empty chessboard and touch each of the 64 squares once and only once? We study this intriguing problem in depth in this exercise.

The knight makes L-shaped moves (over two in one direction and then over one in a perpendicular direction). Thus, from a square in the middle of an empty chessboard, the knight can make eight different moves (numbered 0 through 7) as shown in the following.

Draw an 8-by-8 chessboard on a sheet of paper and attempt a Knight's Tour by hand. Put a 1 in the first square you move to, a 2 in the second square, a 3 in the third, etc. Before starting the tour, estimate how far you think you will get, remembering that a full tour consists of 64 moves. How far did you get? Was this close to your estimate?

Now let us develop a program that will move the knight around a chessboard. The board is represented by an 8-by-8 two-dimensional array board. Each of the squares is initialized to zero. We describe each of the eight possible moves in terms of both their horizontal and vertical components. For example, a move of type 0, consists of moving two squares horizontally to the right and one square vertically upward. Move 2 consists of moving one square horizontally to the left and two squares vertically upward. Horizontal moves to the left and vertical moves upward are indicated with negative numbers. The eight moves may be described by two one-dimensional arrays, horizontal and vertical, as follows:

horizontal[] = {2, 2, 1, 1, -2, -2, -1 -1}

vertical[] = {1, -1, 2, -2, 1, -1, 2, -2}

Let the variables currentRow and currentColumn indicate the row and column of the knight's current position. To make a move of type moveNumber, where moveNumber is between 0 and 7, your program uses the statements

currentRow += vertical[ moveNumber ];

currentColumn += horizontal[ moveNumber ];

Keep a counter that varies from 1 to 64. Record the latest count in each square the knight moves to. Remember to test each potential move to see if the knight has already visited that square, and, of course, test every potential move to make sure that the knight does not land off the chessboard. Now write a program to move the knight around the chessboard. Run the program. How many moves did the knight make?

After attempting to write and run a Knight's Tour program, you have probably developed some valuable insights. We will use these to develop a heuristic (or strategy) for moving the knight. Heuristics do not guarantee success, but a carefully developed heuristic greatly improves the chance of success. You may have observed that the outer squares are more troublesome than the squares nearer the center of the board. In fact, the most troublesome, or inaccessible, squares are the four corners.

Intuition may suggest that you should attempt to move the knight to the most troublesome squares first and leave open those that are easiest to get to, so when the board gets congested near the end of the tour, there will be a greater chance of success.

We may develop an "accessibility heuristic" by classifying each square according to how accessible it is and then always moving the knight to the square (within the knight's L-shaped moves, of course) that is most inaccessible. We label a two-dimensional array accessibility with numbers indicating from how many squares each particular square is accessible. On a blank chessboard, each center square is rated as 8, each corner square is rated as 2 and the other squares have accessibility numbers of 3, 4 or 6 as follows:

2 3 4 4 4 4 3 2

3 4 6 6 6 6 4 3

4 6 8 8 8 8 6 4

4 6 8 8 8 8 6 4

4 6 8 8 8 8 6 4

4 6 8 8 8 8 6 4

3 4 6 6 6 6 4 3

2 3 4 4 4 4 3 2

Now write a version of the Knight's Tour program using the accessibility heuristic. At any time, the knight should move to the square with the lowest accessibility number. In case of a tie, the knight may move to any of the tied squares. Therefore, the tour may begin in any of the four corners. [Note: As the knight moves around the chessboard, your program should reduce the accessibility numbers as more and more squares become occupied. In this way, at any given time during the tour, each available square's accessibility number will remain equal to precisely the number of squares from which that square may be reached.] Run this version of your program. Did you get a full tour? Now modify the program to run 64 tours, one starting from each square of the chessboard. How many full tours did you get?

[Extra credit: 20 points] Write a version of the Knight's Tour program which, when encountering a tie between two or more squares, decides what square to choose by looking ahead to those squares reachable from the "tied" squares. Your program should move to the square for which the next move would arrive at a square with the lowest accessibility number.

For your convenience, the following is the header file for my KnightTour class (KnightTour.h), you are welcome to design your own class.

#ifndef KNIGHT_H

#define KNIGHT_H

class KnightTour

{

public:

        

      //constructor

    KnightTour(int x = 0, int y = 0);

   

    void initialize();

    void getKightTour();

    void updateAccess(int x, int y);

    void nextMove();

     

    bool inBoard(int x, int y);

    void printBoard();

    void printAccess();   

private:

    int board[8][8];

    int access[8][8];

    int currentx, currenty;

    const static int horizontal[8];

    const static int vertical[8];  

};

#endif

The Pseudo-code for getKnightTour() member function is as follows:

Call initialize() member function to set all board entries to zeros and reset the access matrix

set step to 1

set board[current][currenty] to step

while(step is less than 64)

{

      update the access matrix (e.g. updateAccess())

     

      call nextMove() to find the next square to move to

     

      increment step

      set board[currentx][currenty] to step

}

print the board matrix show all move numbers

The pseudo-code for nextMove() member function is as follows:

set minx to 0

set miny to 0

set minAccess to 9

for(k = 0 to 7)

{

      set testx to currentx + vertical[k]

      set testy to currenty + horizontal[k]

      if( (testx, testy) is in board and board[testx][testy] is still zero)

      {

            if(access[testx][testy] < minAccess)

            {

                  set minAccess to access[testx][testy]

                  set minx to testx

                  set miny to testy

            }

      }

}

set currentx to minx

set currenty to miny

Explanation / Answer

Given below are the needed files for the question. Please do rate the answer if it helped. Thank you very much.

If you wish to only see the board for starting postion 0,0 you may comment the line to print the board in the loop since it will display 64 boards and it will scroll of the screen.

KnightTour.h

#ifndef KNIGHT_H
#define KNIGHT_H

class KnightTour
{
public:
  
//constructor
KnightTour(int r = 0, int c = 0);
  
void initialize();
void getKightTour();
void updateAccess(int r, int c);
void nextMove();
  
bool inBoard(int r, int c);
  
void printBoard();
void printAccess();
int getStep();
  
private:
int board[8][8];
int access[8][8];
int currentr, currentc; //current row col
int step;
const static int horizontal[8];
const static int vertical[8];
  
};

#endif

KnightTour.cpp

#include "KnightTour.h"
#include <iostream>

using namespace std;

const int KnightTour::horizontal[8] = {2, 2, 1, 1, -2, -2, -1, -1};
const int KnightTour::vertical[8] = {1, -1, 2, -2, 1, -1, 2, -2};

KnightTour::KnightTour(int r , int c)
{
currentr = r;
currentc = c;
initialize();
  
}


void KnightTour::initialize()
{
  
//initialize the board
for(int i = 0; i < 8; i++)
for(int j = 0; j < 8; j++)
board[i][j] = 0;
  
  
//initialize the accessible matrix
for(int i = 0; i < 8; i++)
for(int j = 0; j < 8; j++)
{
int possible = 0;
int r, c;
//check the 8 possible moves
for(int move = 0; move < 8; move++)
{
r = i + vertical[move];
c = j + horizontal[move];

if(inBoard(r, c))
possible++;
}
access[i][j] = possible;
}
}
void KnightTour::getKightTour()
{
initialize();
step = 1;
board[currentr][currentc] = step;
while(step < 64)
{
updateAccess(currentr, currentc);
nextMove();
step++;
if(board[currentr][currentc] == 0) //check if a valid move was possible or it stayed where it was
board[currentr][currentc] = step;
else
break;
}
}
void KnightTour::updateAccess(int r, int c)
{
for(int move = 0; move < 8; move++)
{
int r1 = r + vertical[move];
int c1 = c + horizontal[move];
if(inBoard(r1, c1) && access[r1][c1] != 0 )
access[r1][c1] -= 1;
}
}

void KnightTour::nextMove()
{
//assume the 1st move will be the move with lowest accessibility
int minr = -1;
int minc = -1;
int minAccess = 9;
int testr, testc;
//now check with each of the remaining moves, which one leads to minimum accessiblity move
for(int k = 0; k < 8; k++)
{
testr = currentr + vertical[k];
testc = currentc + horizontal[k];
if(inBoard(testr, testc) && board[testr][testc] == 0 && access[testr][testc] < minAccess)
{
minAccess = access[testr][testc];
minr = testr;
minc = testc;
}
}
  
if(minr != -1 && minc != -1)
{
currentr = minr;
currentc = minc;
}
  
}

bool KnightTour::inBoard(int r, int c)
{
return (r >= 0 && c >= 0 && r < 8 && c < 8);
}

void KnightTour::printBoard()
{
cout << "Board" << endl;
for(int i = 0; i < 8; i++)
{
cout << endl << endl;
for(int j =0 ; j < 8; j++)
cout << board[i][j] << " ";
}
  
cout << endl << "-------------------" << endl;
  
}
void KnightTour::printAccess()
{
cout << "Access" << endl;
for(int i = 0; i < 8; i++)
{
cout << endl << endl;
for(int j =0 ; j < 8; j++)
cout << access[i][j] << " ";
}
cout << endl << "-------------------" << endl;
}

int KnightTour::getStep()
{
return step;
}

main.cpp

#include "KnightTour.h"
#include <iostream>
using namespace std;
int main()
{
KnightTour kt; //starts at default 0,0
cout << "showing access and board starting from 0,0 " << endl;
kt.printAccess();
kt.getKightTour();
kt.printBoard();

for(int i = 0; i < 8; i++)
for(int j = 0; j <8; j++)
{
kt = KnightTour(i, j);
kt.getKightTour();
kt.getStep();
cout << "Starting at " << i << "," << j << " steps = " << kt.getStep() << endl;
kt.printBoard();
}
  
}

output

showing access and board starting from 0,0

Access

2 3 4 4 4 4 3 2

3 4 6 6 6 6 4 3

4 6 8 8 8 8 6 4

4 6 8 8 8 8 6 4

4 6 8 8 8 8 6 4

4 6 8 8 8 8 6 4

3 4 6 6 6 6 4 3

2 3 4 4 4 4 3 2

-------------------

Board

1 16 53 34 3 18 21 36

54 33 2 17 52 35 4 19

15 64 49 56 45 20 37 22

32 55 44 63 48 51 42 5

61 14 57 50 43 46 23 38

28 31 62 47 58 41 6 9

13 60 29 26 11 8 39 24

30 27 12 59 40 25 10 7

-------------------

Starting at 0,0 steps = 64

Board

1 16 53 34 3 18 21 36

54 33 2 17 52 35 4 19

15 64 49 56 45 20 37 22

32 55 44 63 48 51 42 5

61 14 57 50 43 46 23 38

28 31 62 47 58 41 6 9

13 60 29 26 11 8 39 24

30 27 12 59 40 25 10 7

-------------------

Starting at 0,1 steps = 64

Board

4 1 6 21 28 33 16 19

7 22 3 34 17 20 29 32

2 5 24 27 56 31 18 15

23 8 35 60 25 48 43 30

36 59 26 55 42 57 14 47

9 54 61 58 49 46 41 44

64 37 52 11 62 39 50 13

53 10 63 38 51 12 45 40

-------------------

Starting at 0,2 steps = 64

Board

23 20 1 16 33 38 11 14

2 17 22 37 12 15 32 39

21 24 19 34 55 40 13 10

18 3 56 59 36 47 42 31

25 60 35 54 41 58 9 46

4 53 64 57 48 45 30 43

61 26 51 6 63 28 49 8

52 5 62 27 50 7 44 29

-------------------

Starting at 0,3 steps = 64

Board

32 19 16 1 30 37 14 11

17 2 31 38 15 12 29 36

20 33 18 63 54 35 10 13

3 64 55 34 39 50 53 28

56 21 62 51 58 27 40 9

61 4 57 46 49 52 43 26

22 47 6 59 24 45 8 41

5 60 23 48 7 42 25 44

-------------------

Starting at 0,4 steps = 64

Board

63 14 51 32 1 16 19 34

52 31 64 15 50 33 2 17

13 62 47 54 43 18 35 20

30 53 42 61 46 49 40 3

59 12 55 48 41 44 21 36

26 29 60 45 56 39 4 7

11 58 27 24 9 6 37 22

28 25 10 57 38 23 8 5

-------------------

Starting at 0,5 steps = 64

Board

14 11 40 43 16 1 20 23

41 56 15 12 39 22 17 2

10 13 42 57 44 19 24 21

55 60 45 38 35 50 3 18

46 9 62 51 58 37 34 25

61 54 59 36 49 28 31 4

8 47 52 63 6 33 26 29

53 64 7 48 27 30 5 32

-------------------

Starting at 0,6 steps = 64

Board

63 16 39 42 27 18 1 4

40 51 64 17 38 3 26 19

15 62 41 56 43 28 5 2

52 57 50 61 46 37 20 25

49 14 53 44 55 24 29 6

58 11 60 47 36 45 32 21

13 48 9 54 23 34 7 30

10 59 12 35 8 31 22 33

-------------------

Starting at 0,7 steps = 64

Board

44 41 6 57 20 23 4 1

7 58 43 40 5 2 19 22

42 45 60 27 56 21 24 3

59 8 55 48 39 26 29 18

46 53 38 61 28 49 14 25

9 62 47 54 35 32 17 30

52 37 64 11 50 15 34 13

63 10 51 36 33 12 31 16

-------------------

Starting at 1,0 steps = 64

Board

56 19 2 21 58 35 4 7

1 22 57 36 3 6 51 34

18 55 20 63 52 59 8 5

23 64 53 60 37 50 33 46

54 17 24 49 62 47 38 9

25 14 61 42 39 30 45 32

16 41 12 27 48 43 10 29

13 26 15 40 11 28 31 44

-------------------

Starting at 1,1 steps = 64

Board

63 32 15 2 61 34 17 4

14 1 62 33 16 3 20 35

31 64 13 56 37 60 5 18

12 51 40 59 48 19 36 21

41 30 55 50 57 38 47 6

52 11 58 39 44 49 22 25

29 42 9 54 27 24 7 46

10 53 28 43 8 45 26 23

-------------------

Starting at 1,2 steps = 64

Board

2 31 4 19 24 29 14 17

5 20 1 30 15 18 25 28

32 3 56 23 64 27 16 13

21 6 33 60 55 58 41 26

34 61 22 57 40 63 12 53

7 48 45 62 59 54 39 42

46 35 50 9 44 37 52 11

49 8 47 36 51 10 43 38

-------------------

Starting at 1,3 steps = 64

Board

5 2 7 22 29 34 17 20

8 23 4 1 18 21 30 33

3 6 25 28 35 32 19 16

24 9 46 63 26 41 36 31

47 64 27 56 45 58 15 40

10 55 62 59 50 39 42 37

61 48 53 12 57 44 51 14

54 11 60 49 52 13 38 43

-------------------

Starting at 1,4 steps = 64

Board

52 17 46 61 28 19 2 5

45 64 51 18 1 4 27 20

16 53 60 47 62 29 6 3

59 44 63 50 57 38 21 26

54 15 58 39 48 25 30 7

43 12 49 56 37 40 33 22

14 55 10 41 24 35 8 31

11 42 13 36 9 32 23 34

-------------------

Starting at 1,5 steps = 64

Board

63 14 39 42 25 16 27 2

40 51 64 15 38 1 24 17

13 62 41 56 43 26 3 28

52 57 50 61 46 37 18 23

49 12 53 44 55 22 29 4

58 9 60 47 36 45 32 19

11 48 7 54 21 34 5 30

8 59 10 35 6 31 20 33

-------------------

Starting at 1,6 steps = 64

Board

60 13 46 33 58 15 20 35

45 32 59 14 47 34 1 16

12 61 44 57 50 19 36 21

31 64 51 62 43 48 17 2

52 11 56 49 18 41 22 37

27 30 63 42 55 38 3 6

10 53 28 25 8 5 40 23

29 26 9 54 39 24 7 4

-------------------

Starting at 1,7 steps = 64

Board

23 20 9 52 33 2 7 4

10 51 22 19 8 5 34 1

21 24 53 44 55 32 3 6

50 11 56 59 18 35 42 31

25 60 45 54 43 58 17 36

12 49 64 57 46 39 30 41

61 26 47 14 63 28 37 16

48 13 62 27 38 15 40 29

-------------------

Starting at 2,0 steps = 61

Board

59 2 35 18 57 4 37 20

34 17 58 3 36 19 56 5

1 60 33 0 55 50 21 38

16 0 54 49 32 0 6 47

53 12 31 0 51 48 39 22

30 15 52 43 40 25 46 7

11 42 13 28 9 44 23 26

14 29 10 41 24 27 8 45

-------------------

Starting at 2,1 steps = 64

Board

2 17 62 35 4 19 22 37

61 34 3 18 57 36 5 20

16 1 60 63 46 21 38 23

33 64 45 56 49 58 43 6

52 15 50 59 44 47 24 39

29 32 53 48 55 42 7 10

14 51 30 27 12 9 40 25

31 28 13 54 41 26 11 8

-------------------

Starting at 2,2 steps = 64

Board

63 52 3 18 59 20 5 8

2 17 64 53 4 7 34 21

51 62 1 58 19 60 9 6

16 31 54 61 46 33 22 35

55 50 45 32 57 36 41 10

30 15 56 47 42 25 38 23

49 44 13 28 37 40 11 26

14 29 48 43 12 27 24 39

-------------------

Starting at 2,3 steps = 64

Board

52 15 40 33 2 17 20 35

41 32 51 16 39 34 3 18

14 53 42 1 48 19 36 21

31 50 47 60 43 38 45 4

64 13 54 49 46 59 22 37

27 30 61 58 55 44 5 8

12 63 28 25 10 7 56 23

29 26 11 62 57 24 9 6

-------------------

Starting at 2,4 steps = 64

Board

51 14 57 44 53 16 21 42

56 45 52 15 58 43 2 17

13 50 63 54 1 20 41 22

46 55 32 49 64 59 18 3

33 12 47 62 19 40 23 60

28 31 34 37 48 61 4 7

11 36 29 26 9 6 39 24

30 27 10 35 38 25 8 5

-------------------

Starting at 2,5 steps = 64

Board

8 5 10 25 32 3 20 23

11 26 7 4 21 24 33 2

6 9 28 31 60 1 22 19

27 12 59 44 29 48 55 34

58 43 30 61 56 45 18 47

13 62 57 52 49 54 35 38

42 51 64 15 40 37 46 17

63 14 41 50 53 16 39 36

-------------------

Starting at 2,6 steps = 64

Board

53 28 7 30 55 62 5 2

8 31 54 61 6 3 42 59

27 52 29 56 63 60 1 4

32 9 64 49 16 43 58 41

51 26 33 44 57 48 15 18

10 23 50 37 34 17 40 47

25 36 21 12 45 38 19 14

22 11 24 35 20 13 46 39

-------------------

Starting at 2,7 steps = 64

Board

48 63 4 25 18 21 2 23

5 26 49 62 3 24 17 20

64 47 58 27 60 19 22 1

43 6 61 50 57 28 35 16

46 55 44 59 36 51 12 29

7 42 37 56 39 32 15 34

54 45 40 9 52 13 30 11

41 8 53 38 31 10 33 14

-------------------

Starting at 3,0 steps = 64

Board

52 17 20 3 54 47 22 5

19 2 53 48 21 4 25 46

16 51 18 63 44 55 6 23

1 64 49 56 41 24 45 26

50 15 62 43 58 33 40 7

61 12 57 34 37 42 27 30

14 35 10 59 32 29 8 39

11 60 13 36 9 38 31 28

-------------------

Starting at 3,1 steps = 64

Board

63 20 3 22 59 36 5 8

2 23 64 37 4 7 52 35

19 62 21 58 53 60 9 6

24 1 54 61 38 51 34 47

55 18 25 50 57 48 39 10

26 15 56 43 40 31 46 33

17 42 13 28 49 44 11 30

14 27 16 41 12 29 32 45

-------------------

Starting at 3,2 steps = 64

Board

12 63 14 37 10 39 32 29

15 36 11 64 33 30 9 40

62 13 58 35 38 43 28 31

51 16 1 44 59 34 41 8

2 61 50 57 42 25 46 27

17 52 19 60 45 56 7 24

20 3 54 49 22 5 26 47

53 18 21 4 55 48 23 6

-------------------

Starting at 3,3 steps = 64

Board

27 18 29 32 25 20 3 6

30 33 26 19 2 5 24 21

17 28 31 44 59 22 7 4

34 45 64 1 48 43 60 23

63 16 35 46 61 58 41 8

36 13 62 49 42 47 54 57

15 50 11 38 55 52 9 40

12 37 14 51 10 39 56 53

-------------------

Starting at 3,4 steps = 64

Board

58 15 64 37 60 17 50 39

63 36 59 16 55 38 43 18

14 57 54 61 44 49 40 51

35 62 45 56 1 52 19 42

46 13 34 53 48 41 2 21

33 30 47 24 27 20 5 8

12 25 28 31 10 7 22 3

29 32 11 26 23 4 9 6

-------------------

Starting at 3,5 steps = 64

Board

45 12 47 42 29 14 31 40

48 59 44 13 38 41 28 15

11 46 49 60 43 30 39 32

58 53 64 37 50 1 16 27

63 10 57 52 61 26 33 2

54 7 62 25 36 51 20 17

9 24 5 56 19 22 3 34

6 55 8 23 4 35 18 21

-------------------

Starting at 3,6 steps = 64

Board

38 31 10 61 36 3 8 5

11 60 37 32 9 6 35 2

30 39 64 57 62 33 4 7

59 12 55 40 19 42 1 34

54 29 58 63 56 49 18 21

13 26 53 50 41 20 43 46

28 51 24 15 48 45 22 17

25 14 27 52 23 16 47 44

-------------------

Starting at 3,7 steps = 64

Board

5 40 7 22 3 34 17 20

8 23 4 39 18 21 2 33

41 6 49 24 35 38 19 16

50 9 42 37 48 25 32 1

43 64 47 54 59 36 15 26

10 51 60 63 46 29 56 31

61 44 53 12 55 58 27 14

52 11 62 45 28 13 30 57

-------------------

Starting at 4,0 steps = 64

Board

11 64 13 36 9 38 31 28

14 35 10 63 32 29 8 39

61 12 57 34 37 42 27 30

50 15 62 43 58 33 40 7

1 60 49 56 41 24 45 26

16 51 18 59 44 55 6 23

19 2 53 48 21 4 25 46

52 17 20 3 54 47 22 5

-------------------

Starting at 4,1 steps = 64

Board

14 27 16 41 12 29 32 45

17 42 13 28 57 44 11 30

26 15 56 43 40 31 46 33

55 18 25 58 53 60 39 10

24 1 54 61 38 51 34 47

19 62 21 52 59 48 9 6

2 23 64 37 4 7 50 35

63 20 3 22 49 36 5 8

-------------------

Starting at 4,2 steps = 64

Board

63 28 11 24 15 20 9 22

12 25 62 29 10 23 16 19

61 64 27 14 45 18 21 8

26 13 56 59 30 33 44 17

55 60 1 46 43 58 7 32

2 47 42 57 52 31 34 37

41 54 49 4 39 36 51 6

48 3 40 53 50 5 38 35

-------------------

Starting at 4,3 steps = 64

Board

12 37 14 59 10 39 44 55

15 50 11 38 57 54 9 40

36 13 58 49 60 43 56 45

51 16 35 64 53 48 41 8

34 63 52 1 42 61 46 23

17 28 31 62 47 22 7 4

30 33 26 19 2 5 24 21

27 18 29 32 25 20 3 6

-------------------

Starting at 4,4 steps = 64

Board

15 60 29 58 17 38 27 24

30 57 16 39 28 25 18 37

61 14 59 32 35 40 23 26

56 31 62 41 50 33 36 19

13 64 49 34 1 20 43 22

48 55 10 63 42 51 2 5

9 12 53 46 7 4 21 44

54 47 8 11 52 45 6 3

-------------------

Starting at 4,5 steps = 64

Board

54 9 42 29 52 11 44 27

41 30 53 10 43 28 15 12

8 55 40 49 14 51 26 45

39 48 31 56 63 46 13 16

32 7 64 47 50 1 58 25

35 38 33 22 57 62 17 2

6 21 36 61 4 19 24 59

37 34 5 20 23 60 3 18

-------------------

Starting at 4,6 steps = 64

Board

25 14 27 52 23 16 47 44

28 51 24 15 48 45 22 17

13 26 53 50 41 20 43 46

54 29 58 63 56 49 18 21

59 12 55 40 19 42 1 34

30 39 64 57 62 33 4 7

11 60 37 32 9 6 35 2

38 31 10 61 36 3 8 5

-------------------

Starting at 4,7 steps = 64

Board

52 11 62 45 28 13 30 57

61 44 53 12 55 58 27 14

10 51 60 63 46 29 56 31

43 64 47 54 59 36 15 26

50 9 42 37 48 25 32 1

41 6 49 24 35 38 19 16

8 23 4 39 18 21 2 33

5 40 7 22 3 34 17 20

-------------------

Starting at 5,0 steps = 64

Board

14 29 10 41 24 27 8 45

11 42 13 28 9 44 23 26

30 15 64 43 40 25 46 7

63 12 31 58 55 48 39 22

16 59 56 49 32 53 6 47

1 62 33 54 57 50 21 38

34 17 60 3 36 19 52 5

61 2 35 18 51 4 37 20

-------------------

Starting at 5,1 steps = 64

Board

31 28 13 58 41 26 11 8

14 57 30 27 12 9 40 25

29 32 55 52 59 42 7 10

56 15 60 63 54 45 24 39

33 64 53 46 51 62 43 6

16 1 50 61 44 21 38 23

49 34 3 18 47 36 5 20

2 17 48 35 4 19 22 37

-------------------

Starting at 5,2 steps = 64

Board

14 29 48 45 12 27 24 39

49 46 13 28 37 40 11 26

30 15 56 47 44 25 38 23

55 50 43 32 57 36 41 10

16 31 54 61 42 33 22 35

51 62 1 58 19 60 9 6

2 17 64 53 4 7 34 21

63 52 3 18 59 20 5 8

-------------------

Starting at 5,3 steps = 64

Board

29 26 11 62 57 24 9 6

12 63 28 25 10 7 56 23

27 30 61 58 55 44 5 8

64 13 54 49 46 59 22 37

31 50 47 60 43 38 45 4

14 53 42 1 48 19 36 21

41 32 51 16 39 34 3 18

52 15 40 33 2 17 20 35

-------------------

Starting at 5,4 steps = 64

Board

30 27 10 35 38 25 8 5

11 36 29 26 9 6 39 24

28 31 34 37 58 49 4 7

33 12 59 52 19 40 23 50

46 53 32 57 48 51 18 3

13 64 47 60 1 20 41 22

54 45 62 15 56 43 2 17

63 14 55 44 61 16 21 42

-------------------

Starting at 5,5 steps = 64

Board

59 14 41 50 53 16 39 36

42 51 58 15 40 37 46 17

13 60 63 52 49 54 35 38

64 43 30 57 62 45 18 47

27 12 61 44 29 48 55 34

6 9 28 31 56 1 22 19

11 26 7 4 21 24 33 2

8 5 10 25 32 3 20 23

-------------------

Starting at 5,6 steps = 64

Board

22 11 24 35 20 13 60 39

25 36 21 12 61 38 19 14

10 23 56 37 34 17 40 59

49 26 33 64 57 62 15 18

32 9 50 55 16 43 58 41

27 48 29 44 63 54 1 4

8 31 46 51 6 3 42 53

47 28 7 30 45 52 5 2

-------------------

Starting at 5,7 steps = 64

Board

41 8 55 38 31 10 33 14

56 45 40 9 54 13 30 11

7 42 37 58 39 32 15 34

46 57 44 53 36 51 12 29

43 6 63 50 59 28 35 16

64 47 60 27 52 19 22 1

5 26 49 62 3 24 17 20

48 61 4 25 18 21 2 23

-------------------

Starting at 6,0 steps = 64

Board

13 26 15 40 11 28 31 44

16 41 12 27 62 43 10 29

25 14 61 42 39 30 45 32

54 17 24 63 52 59 38 9

23 64 53 60 37 50 33 46

18 55 20 51 58 47 8 5

1 22 57 36 3 6 49 34

56 19 2 21 48 35 4 7

-------------------

Starting at 6,1 steps = 64

Board

10 53 28 43 8 45 26 23

29 42 9 54 27 24 7 46

52 11 60 39 44 49 22 25

41 30 55 50 59 38 47 6

12 51 40 61 48 19 36 21

31 62 13 56 37 58 5 18

14 1 64 33 16 3 20 35

63 32 15 2 57 34 17 4

-------------------

Starting at 6,2 steps = 64

Board

29 8 27 60 31 10 35 56

26 59 30 9 54 57 32 11

7 28 61 58 43 34 55 36

64 25 42 53 62 51 12 33

21 6 63 44 41 48 37 50

24 3 22 47 52 45 16 13

5 20 1 40 15 18 49 38

2 23 4 19 46 39 14 17

-------------------

Starting at 6,3 steps = 64

Board

54 11 62 49 52 13 38 43

61 48 53 12 57 44 51 14

10 55 60 63 50 39 42 37

47 64 27 56 45 58 15 40

24 9 46 59 26 41 36 31

3 6 25 28 35 32 19 16

8 23 4 1 18 21 30 33

5 2 7 22 29 34 17 20

-------------------

Starting at 6,4 steps = 64

Board

11 40 13 52 9 38 23 36

14 53 10 39 24 35 8 31

41 12 55 34 51 32 37 22

54 15 42 49 56 25 30 7

43 58 47 62 33 50 21 26

16 61 44 57 48 29 6 3

59 46 63 18 1 4 27 20

64 17 60 45 28 19 2 5

-------------------

Starting at 6,5 steps = 64

Board

8 39 10 61 6 37 20 35

11 62 7 38 21 34 5 30

40 9 64 33 60 31 36 19

63 12 41 50 47 22 29 4

42 55 46 59 32 49 18 23

13 58 51 48 45 26 3 28

54 43 56 15 52 1 24 17

57 14 53 44 25 16 27 2

-------------------

Starting at 6,6 steps = 64

Board

43 58 9 54 49 38 7 4

10 55 44 39 8 5 50 37

57 42 59 48 53 46 3 6

60 11 56 45 40 51 36 31

21 64 41 52 47 32 17 2

12 61 22 33 18 35 30 27

23 20 63 14 25 28 1 16

62 13 24 19 34 15 26 29

-------------------

Starting at 6,7 steps = 64

Board

48 13 64 27 46 15 44 29

61 26 47 14 63 28 37 16

12 49 62 57 38 45 30 43

25 60 39 54 41 58 17 36

50 11 56 59 18 35 42 31

21 24 53 40 55 32 3 6

10 51 22 19 8 5 34 1

23 20 9 52 33 2 7 4

-------------------

Starting at 7,0 steps = 64

Board

30 27 12 63 40 25 10 7

13 64 29 26 11 8 39 24

28 31 58 45 62 41 6 9

57 14 61 48 55 44 23 38

32 53 56 59 46 49 42 5

15 60 47 54 43 20 37 22

52 33 2 17 50 35 4 19

1 16 51 34 3 18 21 36

-------------------

Starting at 7,1 steps = 64

Board

53 10 61 38 51 12 45 40

64 37 52 11 62 39 50 13

9 54 63 60 49 46 41 44

36 59 26 55 42 57 14 47

23 8 35 58 25 48 43 30

2 5 24 27 56 31 18 15

7 22 3 34 17 20 29 32

4 1 6 21 28 33 16 19

-------------------

Starting at 7,2 steps = 64

Board

52 5 64 27 50 7 44 29

61 26 51 6 63 28 49 8

4 53 62 57 48 45 30 43

25 60 35 54 41 58 9 46

18 3 56 59 36 47 42 31

21 24 19 34 55 40 13 10

2 17 22 37 12 15 32 39

23 20 1 16 33 38 11 14

-------------------

Starting at 7,3 steps = 64

Board

5 60 23 54 7 56 25 48

22 53 6 57 24 49 8 41

61 4 59 50 55 42 47 26

52 21 62 45 58 27 40 9

3 64 51 34 39 46 43 28

20 33 18 63 44 35 10 13

17 2 31 38 15 12 29 36

32 19 16 1 30 37 14 11

-------------------

Starting at 7,4 steps = 64

Board

28 25 10 57 38 23 8 5

11 58 27 24 9 6 37 22

26 29 60 45 56 39 4 7

59 12 55 48 41 44 21 36

30 53 42 61 46 49 40 3

13 62 47 54 43 18 35 20

52 31 64 15 50 33 2 17

63 14 51 32 1 16 19 34

-------------------

Starting at 7,5 steps = 64

Board

53 64 7 48 27 30 5 32

8 47 52 63 6 33 26 29

61 54 59 36 49 28 31 4

46 9 62 51 58 37 34 25

55 60 45 38 35 50 3 18

10 13 42 57 44 19 24 21

41 56 15 12 39 22 17 2

14 11 40 43 16 1 20 23

-------------------

Starting at 7,6 steps = 64

Board

10 39 12 61 8 37 22 35

13 62 9 38 23 34 7 30

40 11 64 33 60 31 36 21

63 14 41 50 47 24 29 6

42 55 46 59 32 49 20 25

15 58 51 48 45 28 5 2

54 43 56 17 52 3 26 19

57 16 53 44 27 18 1 4

-------------------

Starting at 7,7 steps = 64

Board

63 10 51 36 33 12 31 16

52 37 64 11 50 15 34 13

9 62 47 54 35 32 17 30

46 53 38 61 28 49 14 25

59 8 55 48 39 26 29 18

42 45 60 27 56 21 24 3

7 58 43 40 5 2 19 22

44 41 6 57 20 23 4 1

-------------------

Program ended with exit code: 0