thinkerman / mars-rover-javascript

Mars Rover coding challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

// OUTPUT // The output for each rover should be its final co-ordinates and the direction.

// i.e. The rover's current coordinates are (0, 4) and it is facing S

// The above state could be achieved by the following sequence:

// Input: M // Output: The rover's current coordinates are (0, 1) and it is facing N // Input: M // Output: The rover's current coordinates are (0, 2) and it is facing N // Input: M // Output: The rover's current coordinates are (0, 3) and it is facing N // Input: M // Output: The rover's current coordinates are (0, 4) and it is facing N // Input: L // Output: The rover's current coordinates are (0, 4) and it is facing W // Input: L // Output: The rover's current coordinates are (0, 4) and it is facing S

// Challenge:

// Note: It would be helpful to read and understand each of these before starting. // You’re welcomed to use an Object-Oriented approach or a Functional one.

// 1. Design a class or object to describe the Rover. // 2. Add methods or functions to support the command to move, and the command to change direction. // 3. Return the result, formatted as per the above

// Hint: “There are stretch goals which will highlight boundaries to the space, adding additional rovers, or adding boulders in a couple grid locations”.

// With limited time, there’s no rush to finish the challenge or get to the stretch goals. But if there’s time we will have some fun with it.

About

Mars Rover coding challenge


Languages

Language:JavaScript 100.0%