The Mars Rover project is a Java based program that simulates how robotic rovers move across a plateau on Mars. The rovers can turn left or right and move forward according to a series of commands. This project follows OOP principles and includes thorough testing to ensure everything works properly.
- Simulates rover movement on a grid-like plateau.
- Accepts instructions for the rover to move forward and turn left or right.
- Ensures rovers stay within the plateau boundaries.
- Includes tests to check that the program behaves correctly.
To run this project, you need to have the following installed ->
- Java Development Kit (JDK) 21
- Maven installed on your machine
Clone the repository: ''' bash git clone https://github.com/kadri-k/mars_rover.git cd mars-rover
''' bash mvn clean install
- Compile the project using Maven: mvn clean compile
- Run the MarsRoverUI class: mvn exec:java -Dexec.mainClass="com.yourproject.MarsRoverUI"
Modify the input in MarsRoverApp.java to match your requirements. The input format should be as follows: 5 5 # Plateau size (width and height) 1 2 N # Starting position of the rover (x-coordinate, y-coordinate, direction) LMLMLMLMM # Movement instructions for the rover 3 3 E # Starting position of another rover (optional) MMRMMRMRRM # Movement instructions for the second rover (optional)
mvn test
- Fork this repository.
- Create a new branch (git checkout -b feature/your-feature).
- Commit your changes (git commit -m 'Add new feature').
- Push to the branch (git push origin feature/your-feature).
- Open a pull request.