The program above is a simulation of the problem leetcode/unique-paths-II. The green block represents the robot that will travel in a red-trailed path.

The grid has selectable obstacles, it dodges these obstacles to find its destination. It follows a recursive path and backtracks to find a unique path.

Note: The program uses recursion and backtracking for visual purposes only, the actual problem can be solved using Dynamic programming.