Skip to content

AlexDede/the-mars-rover-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Mars Rover Challenge

Assumptions:

  1. The program will display an error when the rover's next step is impossible due to the fact this next step will result in rover going beyond the plateau. Also, the following rovers will not be processed
  2. Assuming that an unlimited number of rovers can be on the plateau, the program will show an error when the next rover's step is impossible due to the fact that this next spot is already occupied by another rover. All following rovers will not be processed.
  3. Given that the second rover won't start to move until the first one has finished moving, then we assume that all rovers cannot start from the same position.
  4. An error message will be displayed if NASA sends an unexpected string of letters to rovers (other from 'L', 'R' and 'M'. 'L')
  5. I assume that each rover will always have two lines of input corresponding to it (under two lines I mean position and command)
  6. The program will be printing the results right after each rover completes his movement.

Requirements:

  1. Java 1.8+
  2. Maven 3.6+

How to build and run application

  1. mvn clean package
  2. java -jar ./target the-mars-rover-challenge.jar <full path to the file with input data>.txt

File sample you can find in the root of the repository (sample-data.txt)

Example:

mvn clean install
java -jar ./target/the-mars-rover-challenge.jar ./sample-data.txt

About

The Mars Rover Challenge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages