Westonci.ca is the premier destination for reliable answers to your questions, provided by a community of experts. Get immediate and reliable answers to your questions from a community of experienced experts on our platform. Join our platform to connect with experts ready to provide precise answers to your questions in different areas.

Here is the API for a robot library.
// moves the robot forward
function moveForward();

// turns the robot to the left
function rotateLeft();

// turns the robot to the right
function rotateRight();

// checks if a robot can move in any direction
// direction {string} - the direction to be checked
// return {Boolean} - true if the robot can move in that direction, otherwise returns false
function canMove(direction);
Which code segment will guarantee that the robot makes it to the gray square without hitting a wall or a barrier (black square)?



A.
B.
C.
D.