UNPKG

@2d-game-grid/square

Version:
12 lines (11 loc) 374 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.manhattanDistance = manhattanDistance; /** * @param start The start coordinate * @param end The end coordinate * @returns The distance between the given coordinates */ function manhattanDistance(start, end) { return Math.abs(start.row - end.row) + Math.abs(start.col - end.col); }