Interpret the positioning of a rover within a given plateau. The details are described here.
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.
- 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;
- Open the prompt command;
- Clone the project:
"git clone https://github.com/rafaeldev/test-rover.git"
; - Enter on root folder project and run
"clean mvn package"
; - Access the target path. A jar file with name "rover-1.0-SNAPSHOT.jar" will be created;
- Run the JAR:
"java -jar rover-1.0-SNAPSHOT.jar"
;