Advertisement
Guest User

Untitled

a guest
Nov 12th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. void find_path(int mat[][8], int aux_mat[][8], int lines, int cols, int l, int c)
  2. {
  3. if(c<cols)
  4. {
  5. if(check(mat, aux_mat, lines, cols, l-1, c)==1) //NORTE
  6. {
  7. aux_mat[l-1][c] = 1;
  8. find_path(mat, aux_mat, lines, cols, l-1, c);
  9. }
  10. if(check(mat, aux_mat, lines, cols, l, c+1)==1) //ESTE
  11. {
  12. aux_mat[l][c+1] = 1;
  13. find_path(mat, aux_mat, lines, cols, l, c+1);
  14. }
  15. if(check(mat, aux_mat, lines, cols, l+1, c)==1) //SUL
  16. {
  17. aux_mat[l+1][c] = 1;
  18. find_path(mat, aux_mat, lines, cols, l+1, c);
  19. }
  20. if(check(mat, aux_mat, lines, cols, l, c-1)==1) //OESTE
  21. {
  22. aux_mat[l][c-1] = 1;
  23. find_path(mat, aux_mat, lines, cols, l, c-1);
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement