Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void find_path(int mat[][8], int aux_mat[][8], int lines, int cols, int l, int c)
- {
- if(c<cols)
- {
- if(check(mat, aux_mat, lines, cols, l-1, c)==1) //NORTE
- {
- aux_mat[l-1][c] = 1;
- find_path(mat, aux_mat, lines, cols, l-1, c);
- }
- if(check(mat, aux_mat, lines, cols, l, c+1)==1) //ESTE
- {
- aux_mat[l][c+1] = 1;
- find_path(mat, aux_mat, lines, cols, l, c+1);
- }
- if(check(mat, aux_mat, lines, cols, l+1, c)==1) //SUL
- {
- aux_mat[l+1][c] = 1;
- find_path(mat, aux_mat, lines, cols, l+1, c);
- }
- if(check(mat, aux_mat, lines, cols, l, c-1)==1) //OESTE
- {
- aux_mat[l][c-1] = 1;
- find_path(mat, aux_mat, lines, cols, l, c-1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement