Escape the Labyrinth!
You are stuck in a labyrinth. You only have your brain and a map. Now you need to find a way out, of course your brain doesn't have much memory (or else you wouldn't be stuck!) so you need to optimize your mental code for size. Of course we can't trivially program in the brain-language, so your brain will also accept any other language.
Your input will be a Matrix. You may encode it however serves your language best as long as the format doesn't encode additional information. For the purpose of this challenge I will use a list of lists for representation and explanation.
Said matrix will contain four distinct values:
0: This marks a spot you can move onto
1: This marks a wall
2: This marks the starting point
3: This marks the target point
It is guaranteed that there will be exactly one occurence of type-3 and type-2. You may also change the above values / data-types to your liking as long as you don't encode additional information.
It is guaranteed that you will get an input that has a solution. If the input doesn't have a valid solution, the behavior is left undefined. Your program may not terminate, it may error out, it may simply return nothing, it may blow up, it may become a political activist or it may do something else.
You may assume that the input labyrinth is walled-off, that is you can't actually "leave" the labyrinth.
Your output will be sequence of four different values:
L: Stands for left
R: Stands for right
U: Stands for Up
D: Stands for Down
You may change the values and data types of the above constants to your liking, as long as you document these changes and you can uniquely infer the path.
What to do?
Given the labyrinth, start your virtual character at the position tagged
2 and find a way to the position tagged
3. You may not pass through walls (
1 cells) and you may only go one step up, left, right or down in each step. You also need to document your action of course in each step, ie output it as described above.
Note: You do not have to find the shortest path, but rather a path.
This is code-golf, so the shortest solution in bytes wins! Standard loophole rules apply of course. Standard I/O rules also apply.
might result in: