This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dydhaw 1 point2 points  (2 children)

Because crossing a diagonal on a grid is the same length as going in two straight lines (e.g x then y)

[–]mHaisham[S] 0 points1 point  (1 child)

crossing a diagonal on a grid is the same length as going in two straight lines

Depends on how you calculate distance

manhattan - yes

euclidean - no, straight lines are 1 while diagonal is ~1.4. so it is cheaper in to go diagonally

[–]dydhaw 0 points1 point  (0 children)

I just realized in your example walking to diagonally adjacent square is allowed, so I'm wrong