This challenge consists of one function that returns the rovers' updated location and heading after it was moved from one point to another. The challenge includes a file for testing the function.
The roverMoves function takes two parameters; one is the rover's current position, and the second one is a string that gives moving instructions to the rover. The roverMoves returns a string containing the rover's updated location, which consists of x and y-axis relative to the rover's start point and direction, which will be one of the cardinal compass points N E S W.
- currentPositon
"0 0 N"
- movingInstructions
"MMLMMMM"
"-4 2 W"
Clone down this repo and in the terminal run:
npm install
>
npm test rover-test.js