/mars-rover

Send commands to robotic rovers and receive final coordinates.

Primary LanguageJavaScript

Mars Rover

Send commands to robotic rovers and receive final coordinates.

Requirements:

  • Node.js 16

Install

$ npm install

Testing

$ npm run test

Usage

const { sendCommands } = require("./src/send-commands.js");

const finalCoordinates = sendCommands(`1 2 N\nLMLMLMLMM\n3 3 E\nMRRMMRMRRM`);

console.log(finalCoordinates);
// 1 3 N
// 2 3 S