Rat in a maze
The rat starts at the top left and wants the cheese at the bottom right. From each cell it tries the moves in the order D, L, R, U: a move is allowed onto open floor, inside the maze, that isn't already on its path. When the cheese is reached the path is saved; when every move from a cell is tried, the rat steps back and the cell is free again for other paths.
Stone blocks are walls (0 in the input). The green trail is the path so far, each cell marked with the move that left it. A red cell is a dead end. allPaths collects the paths in the order they are found, which is sorted.