Skip to content

This code is a possible solution for the Martian Robots problem.

Notifications You must be signed in to change notification settings

alibeylan/marsRedRover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

marsRedRover

Description

This code is a possible solution for the Martian Robots problem.
    -The user inputs the size of a planet in the form (x y).
    -Then, the user inputs the position and location of a robot in the form (x y z) where z is the orientation determined by N, S, E, W.

    -Finally the user inputs the serie of instructions that the robot has to follow in the form L, R and F where L means turn left, R means turn righ and F means move forward.

    -When the user wants to stop adding robots, only has to input the word "finish"

If a robot falls, it will print the final position plus the work LOST

If a robot "falls" from the planet, it ill leave a "scent", preventing other robots to commit the same mistake and therefore prints the last save position.

How to run it?

    1. Clone the repository to your computer
    2. Go to the directory from command line
    3. Compile using javac Main.java
    4. Run using java Main
    5. Follow the instructions that are shown in command line

About

This code is a possible solution for the Martian Robots problem.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages