#include #include #include #include #include #include #include int t1[6]={-2,-2,0,2,2,0}; int t2[6]={-1,1,2,1,-1,-2}; int visited[200][200]; int n,w=0; char c[500],c1,c2,c3; struct Node { int x,y,dist; char a,b,e; }; int front=0,rear=-1; struct Node q[200]; int valid(int x,int y) { if(x<0||y<0||x>=n||y>=n) return 0; else return 1; } int printShortestPath(int n,struct Node src,struct Node dest) { // Print the distance along with the sequence of moves. q[++rear]=src; while(front!=rear+1) { struct Node p=q[front++]; int x=p.x; int y=p.y; int dist=p.dist; if(!visited[x][y]) { visited[x][y]=1; c[w]=p.a; w++; c[w]=p.b; w++; c[w]=p.e; w++; if(x==dest.x && y==dest.y) { for(int i=0;i