ParanoidPanda

Untitled

Nov 2nd, 2015
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. void PathFinder::FindMinimal(int x, int y, int c_wave){
  2. if (path[x][y] != 0){
  3. path[x][y] = 666;
  4. if (y + 1 < l_row && ((lab[x][y + 1] == 0) || ((lab[x][y + 1] != -1) && (lab[x][y + 1] == c_wave - 1)))){
  5. FindMinimal(x, y + 1, c_wave - 1);
  6. }
  7. else if (x + 1 < l_col && ((lab[x + 1][y] == 0) || ((lab[x + 1][y] != -1) && (lab[x + 1][y] == c_wave - 1)))){
  8. FindMinimal(x + 1, y, c_wave - 1);
  9. }
  10. else if (y - 1 >= 0 && ((lab[x][y - 1] == 0) || ((lab[x][y - 1] != -1) && (lab[x][y - 1] == c_wave - 1)))){
  11. FindMinimal(x, y - 1, c_wave - 1);
  12. }
  13. else if (x - 1 >= 0((lab[x - 1][y] == 0) || ((lab[x - 1][y] != -1) && (lab[x - 1][y] == c_wave - 1)))){
  14. FindMinimal(x - 1, y, c_wave - 1);
  15. }
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment