Answer:
For our homework we have to listen to a podcast
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)
Answer:
Option (A)
Explanation:
See attachment for options
From the options, the code segment of option (A) answers the question and the explanation is as follows:
I added a second attachment which illustrates the movement
function (solveMaze) {
moveForward(); ---- The robot moves up (to position 1)
moveForward(); ---- The robot moves up (to position 2)
rotateRight(); ---- The robot changes where it faces (however, it is still at position 2)
while(canMove("forward")) { moveForward(); } ---- This is repeated until the robot reaches the end of the grid (i.e. position 3 and 4)
rotateLeft(); ---- The robot changes where it faces (however, it is still at position 4)
moveForward(); ---- The robot moves up to the gray square
List 5 ways by which Artificial intelligence (AI) can be used to drive our business.
Answer:
start a website
Explanation:
true