- #71

- 926

- 483

Let us fix our king at some arbitrary origin, and then let us draw lines that extend in the four 'cardinal' directions around the king. Here is a more qualitative description of the method first:

1. Set up boundary lines for your king emanating from his current position

2. For a given destination, evaluate whether it lies on any of the 4 boundary lines

- If it lies on a boundary line, then move in that respective direction and then go back to step 2

3. If not, see which quadrant the destination is in and move diagonally 1 move in that direction - then go back to one and repeat

I see a good effort here but I can't visualize it in the exact way needed.

Let us define a cartesian coordinate system such that the centre of each square is defined by a pair of integer coordinates ##(x,y)## and our King will start at ##(0,0)## .

For a given destination ##(a,b)## , let us assume that ##a > b## . We will end up moving diagonally b times and then vertically ##a - b## times. Therefore, for destination ##(a,b)## , we will only move ##|a| - |b|+ |b| = |a|## times.

This makes sense following on from part (a). Thinking about the possible squares (that the king can land after n moves) as an area of a square ##(2n + 1)^2## as written by fbs7 for the general n. For us to reach a square in the minimum number of moves ##(n)## , we need ##n## such that it is the first square to include our destination point. This will only happen if n = number of ##\textbf{n = number of moves = max(|a|,|b|)}## for all n.

I don't ask for a rigorous way of describing the minimum number of moves required to reach a destination. I just ask for the optimal strategy for this, described as a number of steps. So, moving in the diagonal direction as you say, is the first step. Now, from what you write I see that you're on the right way for the next step but how can we describe it in simple words i.e. next, what is the move in order to reach the destination, independently of whether it is on the diagonal or not?