pathfinding
Version:
Comprehensive pathfinding library for grid based games
65 lines (64 loc) • 2.58 kB
JavaScript
module.exports = [
{
startX: 0,
startY: 0,
endX: 1,
endY: 1,
matrix: [[0, 0],
[ ]],
expectedLength: 3,
},
{
startX: 1,
startY: 1,
endX: 4,
endY: 4,
matrix: [[0, 0, 0, 0, 0],
[ ],
[ ],
[ ],
[ ],
[ ]],
expectedLength: 9,
},
{
startX: 0,
startY: 3,
endX: 3,
endY: 3,
matrix: [[0, 0, 0, 0, 0],
[ ],
[ ],
[ ],
[ ],
[ ]],
expectedLength: 10,
},
{
startX: 4,
startY: 4,
endX: 19,
endY: 19,
matrix: [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ ],
[ ],
[ ],
[ ],
[ ],
[ ],
[ ],
[ ],
[ ],
[ ],
[ ],
[ ],
[ ],
[ ],
[ ],
[ ],
[ ],
[ ],
[ ]],
expectedLength: 31,
},
];