#include #include #include using std::cout; using std::cin; using std::endl; using std::setw; const int size = 8; int K[size][size]; Accessibility[size][size][size]; int row, col, times, index; void print(); void Heuristic( int times, int row, int col); int ver[]= { -1, -2, -2, -1, 1, 2, 2, 1 } ; int hor[]= { 2, 1, -1, -2, -2, -1, 1, 2 } ; //int ver[]= { -1, 2, 2, -1, 1, -2, -2, 1 } ; //int hor[]= { 2, 1, -1, -2, -2, -1, 1, 2 } ; void main() { index = 0; times = 0; int Access; for ( int row = 0; row < size; col++ ) { for ( int col = 0; col < size; row++ ) { int Acess = 0; for ( int i = 0; i < size; i++ ) { next_row = row + ver[i]; next_col = col + hor[i]; if ( next_row >= 0 && next_row <= size-1 && next_col >= 0 && next_col <= size-1 && K[next_row][next_col] == 0 ) { Accessibility[row][col][i] = Access; Access++; } } } } while ( times != 64 ) { Heuristic ( times, row, col ); times++; } getch(); } void Heuristic ( int times, int row, int col ) { int move = K[row +