A Pen created on CodePen.io. Original URL: https://codepen.io/nikitashah30/pen/PorGBjV.
This assignment is part of the "Web Development Fundamentals" course (JavaScript Fundamentals Assignment 1) offered by WebDevOpen.
We are sending a rover to Mars and we need to be able to move it through a series of instructions sent from the Earth.
The Mars Rover in this problem context is too independent. Meaning, it cannot move and turn at the same time. For example, if the rover wants to move to the left, it's first move must be a turn, followed by a step forward as the next move.
Also, the rover is on a test mission. NASA has placed the rover on a 10 x 10 grid to make sure all is well before it is shipped off to Mars.
The following is to be implemented as part of the solution in JavaScript:
- Create a function to turn the rover.
- Create a function to move the rover forward or backward based on its direction.
- Create a function to receive a list of commands and move based on those commands.