Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void PathFinder::FindMinimal(int x, int y, int c_wave){
- if (path[x][y] != 0){
- path[x][y] = 666;
- if (y + 1 < l_row && ((lab[x][y + 1] == 0) || ((lab[x][y + 1] != -1) && (lab[x][y + 1] == c_wave - 1)))){
- FindMinimal(x, y + 1, c_wave - 1);
- }
- else if (x + 1 < l_col && ((lab[x + 1][y] == 0) || ((lab[x + 1][y] != -1) && (lab[x + 1][y] == c_wave - 1)))){
- FindMinimal(x + 1, y, c_wave - 1);
- }
- else if (y - 1 >= 0 && ((lab[x][y - 1] == 0) || ((lab[x][y - 1] != -1) && (lab[x][y - 1] == c_wave - 1)))){
- FindMinimal(x, y - 1, c_wave - 1);
- }
- else if (x - 1 >= 0((lab[x - 1][y] == 0) || ((lab[x - 1][y] != -1) && (lab[x - 1][y] == c_wave - 1)))){
- FindMinimal(x - 1, y, c_wave - 1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment