int maze[][]私の迷路は、を含む2次元のint配列0,1,START(2),GOAL(3)です。最短経路を印刷したい。
関数がありますが、最短パスではなく、最後まで1つのパスが表示されます。
bool RenderThread::find_path(int x, int y)
{
    int maze_size=mmaze->size*2;
    if ( x < 0 || x > maze_size  || y < 0 || y > maze_size  ) return FALSE;
    if ( toSolve1->maze_data[y][x] == G ) return TRUE;
    if ( toSolve1->maze_data[y][x] != PATH && toSolve1->maze_data[y][x] != S ) return FALSE;
    toSolve1->setRed(y,x);
    if ( find_path(x, y - 1) == TRUE ) return TRUE;
    if ( find_path(x + 1, y) == TRUE ) return TRUE;
    if ( find_path(x, y + 1) == TRUE ) return TRUE;
    if ( find_path(x - 1, y) == TRUE ) return TRUE;
    toSolve1->setPath(y,x);
    return FALSE;
}