/test-rover

Be a Ninja! Oss!

Primary LanguageJava

Premises (summarized)

Interpret the positioning of a rover within a given plateau. The details are described here.

Result

The idea is very simple! I needed to create only three POJOs:

  • Rover
  • Plateau
  • Coordinates

Rover and Plateau are actors taken from the explanatory text of the project. Coordinates is a structure about the input data, where have 1 Plateau for several Rovers.

Decisions

  • A Rover which exit inside the Plateau, moving to Rover.X < 0 | Rover.Y < 0 | Rover.X > Plateau.X | Rover.X > Plateau.Y, throw an Exception;
  • A Rover which start position is out the Plateau (Rover.X < 0 | Rover.Y < 0 | Rover.X > Plateau.X | Rover.X > Plateau.Y), throw an Exception;
  • A Command which does not exist, throw an Exception;
  • A Guidance which does not exist, throw an Exception;

Project dependencies

Build and run

  1. Open the prompt command;
  2. Clone the project: "git clone https://github.com/rafaeldev/test-rover.git";
  3. Enter on root folder project and run "clean mvn package";
  4. Access the target path. A jar file with name "rover-1.0-SNAPSHOT.jar" will be created;
  5. Run the JAR: "java -jar rover-1.0-SNAPSHOT.jar";

Running the JAR