distance between two points, in moves */
| 654 | |
| 655 | /* distance between two points, in moves */ |
| 656 | int |
| 657 | distmin(coordxy x0, coordxy y0, coordxy x1, coordxy y1) |
| 658 | { |
| 659 | coordxy dx = x0 - x1, dy = y0 - y1; |
| 660 | |
| 661 | if (dx < 0) |
| 662 | dx = -dx; |
| 663 | if (dy < 0) |
| 664 | dy = -dy; |
| 665 | /* The minimum number of moves to get from (x0,y0) to (x1,y1) is the |
| 666 | * larger of the [absolute value of the] two deltas. |
| 667 | */ |
| 668 | return (dx < dy) ? dy : dx; |
| 669 | } |
| 670 | |
| 671 | /* square of Euclidean distance between pair of pts */ |
| 672 | int |
no outgoing calls
no test coverage detected