Как работает приведённый рекурсивный метод? - C#

Узнай цену своей работы

Формулировка задачи:

        
public bool find_path(int cur_x, int cur_y, int move_num)
        {
            Ar[cur_x, cur_y] = move_num;
            if (move_num > max_moves)
                return true;
 
            for (int i = 0; i < move_types; ++i)
            {
                int next_x = cur_x + possible_moves[i, 0];
                int next_y = cur_y + possible_moves[i, 1];
                if (move_possible(next_x, next_y) && find_path(next_x, next_y, 
                    move_num + 1))
                    return true;
            }
 
            Ar[cur_x, cur_y] = 0;
            --move_num;
            return false;
        }
Скажите пожалуйста когда попадаем на
 return false
мы возвращаемся на проверку
if (move_possible(next_x, next_y) && find_path(next_x, next_y, move_num + 1))
и так пока не будет true лишь тогда только выйдем. Почему при
 return false
мы попадаем имеено на ветку
if
?

Решение задачи: «Как работает приведённый рекурсивный метод?»

textual
Листинг программы
if (move_possible(next_x, next_y) && find_path(next_x, next_y, move_num + 1))

Оцени полезность:

11   голосов , оценка 3.727 из 5