#include #include #include #include #include #include #include typedef struct { int x; int y; }coordinate; unsigned char **vectorMap; //unsigned short *dist; //coordinate *q; int getNumberOfMove3(int x, int y, int dx, int dy, int n){ coordinate q[1000]; int dist[1000]; int front = 0; int rear = 0; int x1; int y1; int x2; int y2; int move; coordinate possibleMove[8]; q[rear].x = n-1; q[rear].y = n-1; dist[rear]=0; rear++; vectorMap[n-1][n-1] = 1; possibleMove[0].x = 1*dx; possibleMove[0].y = 1*dy; possibleMove[1].x = -1*dx; possibleMove[1].y = 1*dy; possibleMove[2].x = 1*dx; possibleMove[2].y = -1*dy; possibleMove[3].x = -1*dx; possibleMove[3].y = -1*dy; possibleMove[4].x = 1*dy; possibleMove[4].y = 1*dx; possibleMove[5].x = -1*dy; possibleMove[5].y = 1*dx; possibleMove[6].x = 1*dy; possibleMove[6].y = -1*dx; possibleMove[7].x = -1*dy; possibleMove[7].y = -1*dx; while(rear!=front){ x1 = q[front].x; y1 = q[front].y; move = dist[front]; front++; if(x1 == x && y1 == y) break; for(int i=0; i<8; i++){ x2 = x1 + possibleMove[i].x; y2 = y1 + possibleMove[i].y; if(x2>=0 && x2=0 && y2