title: Tell which direction one is going (left/right) given 2 coordinates
body: <p>If you had a coordinate system or map (or a 2D array if you will) and each cell was numbered from [0,0] to [m,n]. <strong>How would it be possible to tell which direction one was going each step</strong> given a start and a destination coordinate? One can go 8 directions if not at border of the grid (North, South, North-West etc.). So there is no going up or down just left/right etc.</p>
  
  <p>The goal is to have a sequence of "Go right", "Go half-left", ... up to the destination <strong>considering which direction one is looking at all times.</strong> For example if one is looking to left side of the map and moving forward one will land in the same cell as someone who is looking up the grid but going left.</p>
  
  <p><strong>Example</strong></p>
  
  <p>From [0,0] to [2,1]. For illustration reasons I drew 2 steps (or three steps if you count the step into the grid). Each arrow also tells from which direction one entered the cell also the direction one looks after entering. For example in cell [1,1] one looks North-East.</p>
  
  <p><img src="https://i.stack.imgur.com/uU58v.png" alt="enter image description here"></p>
  
  <p>I hope this is not too off-topic, but in my opinion it is a programming problem. How you answer is up to you. I implemented this as a graph in Java</p>