Copy the code labyrinth(3d).h from line 8 to 149(153) to Label 1
This code builds a labyrinth without blocks.
vec grid; cin >> h >> w; grid.resize(h); for (int i=0;i<h;i++) grid[i].resize(w); /* 3d vec3d grid; cin >> d1 >> d2 >> d3; grid.resize(d1); for (int i=0;i<d1;i++) { grid[i].resize(d2); for (int j=0;j<d2;j++) { grid[i][j].resize(d3); } } */
If you want to set a block at (x, y[, z])[0<=x<d3, 0<=y<d2[, 0<=z<d1]], write this code
grid[z][y][x] = 1;
Notes : (p)/(p1)/(p2) = ([z, ]y, x)
This code checks if there is a way from (cy, cx) to (ey, ex).
cout << det(grid, p1, p2); // bool
This code extends grid from (p1) with 1.
extend(grid, p1);
This code counts how many units can be reached from (p1).
cout << extendv(grid, p1); // int
This code counts how many steps to go from (p1) to (p2).
cout << step(grid, p1, p2); // int
This code outputs a path from (p1) to (p2).(Format : (p)).
path(grid, p1, p2);
Fill your main code here.