Note: this is already a quite complex problem. Mainly if you want a challenge!

Write a bash script that simulates the movements of a robot on an infinite grid. The robot can turn right, turn left, and advance. The robot always starts at coordinates {0, 0} facing north. The script should process a series of instructions provided as separate arguments and output the robot’s final position and direction.

Instructions:

Example Output:

$ ./robot_simulator.sh R A A L A L
Final position: {2, 1}
Facing: west