android-pathfinding
Android pathfinding
dependencies {
implementation 'com.github.planet0104:android-pathfinding:1.0.0'
}
int[][] grid = new int[][]{
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1},
{0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1},
{1,0,0,1,0,0,1,1,1,1,1,1,1,0,0,1},
{1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1},
{1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1},
{1,0,0,1,1,1,1,1,1,1,0,0,1,1,1,1},
{1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1},
{1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1},
{1,0,0,1,0,0,1,0,0,1,1,1,1,0,0,1},
{1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1},
{1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1},
{1,0,0,1,1,1,1,0,0,1,0,0,1,0,0,1},
{1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0},
{1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
};
PathFinding.loadMap(grid);
int[] points = PathFinding.findPath(0, 1, 15, 14);