Simple program that executes the desired motions of your player on a grid according to the position of the obstacles.