WatneyRescue.java is a Java program that simulates a rescue mission for a stranded astronaut named Mark Watney. The program uses a grid system to represent the Martian surface and includes various obstacles such as boulders, craters, and sand traps. The goal of the program is to navigate a rover to the location of the stranded astronaut, pick him up, and bring him back to the base camp.
To run this program, you will need to have Java installed on your computer. If you don't have Java installed, you can download and install it from the following link:
Once you have Java installed, you can download or clone this repository using the following command:
git clone https://github.com/etsond/rescue.git
To use this program, open a terminal or command prompt and navigate to the directory where you downloaded or cloned this repository. Then navigate to the rescue directory and run the following command:
javac WatneyRescue.java
This will compile the program and create a class file called WatneyRescue.class. To run the program, enter the following command:
java WatneyRescue
The program will prompt you to enter the size of the grid and the location of the obstacles. Once you have entered this information, the program will simulate the rescue mission and output the path taken by the rover to reach the stranded astronaut.
This program is licensed under the MIT License. You are free to use, modify, and distribute this program for any purpose.
Sample Run 1
Do you want 'd' distance mode, 'r' rover mode, or 'q' quit? d How many meters to Watney? 435 Contingencies given distance 435.0 from Lewis to Watney:
- 15 | 15 | 431
- 15 | 18 | 431
- 15 | 21 | 430
- 15 | 24 | 429
- 15 | 27 | 429
- 15 | 30 | 428
- 20 | 15 | 430
- 20 | 18 | 429
- 20 | 21 | 428
- 20 | 24 | 427
- 20 | 27 | 427
- 20 | 30 | 426
- 25 | 15 | 429
- 25 | 18 | 428
- 25 | 21 | 427
- 25 | 24 | 425
- 25 | 27 | 424
- 25 | 30 | 423
- 30 | 15 | 428
- 30 | 18 | 426
- 30 | 21 | 425
- 30 | 24 | 424
- 30 | 27 | 422
- 30 | 30 | 421
- 35 | 15 | 427
- 35 | 18 | 425
- 35 | 21 | 423
- 35 | 24 | 422
- 35 | 27 | 420
- 35 | 30 | 419
- 40 | 15 | 426
- 40 | 18 | 424
- 40 | 21 | 422
- 40 | 24 | 420
- 40 | 27 | 418
- 40 | 30 | 416
- 45 | 15 | 425
- 45 | 18 | 422
- 45 | 21 | 420
- 45 | 24 | 418
- 45 | 27 | 416
- 45 | 30 | 414
- 50 | 15 | 424
- 50 | 18 | 421
- 50 | 21 | 419
- 50 | 24 | 417
- 50 | 27 | 415
- 50 | 30 | 412
- 55 | 15 | 423
- 55 | 18 | 420
- 55 | 21 | 418
- 55 | 24 | 416
- 55 | 27 | 413
- 55 | 30 | 411
- 60 | 15 | 422
- 60 | 18 | 420
- 60 | 21 | 417
- 60 | 24 | 414
- 60 | 27 | 412
- 60 | 30 | 409
- 65 | 15 | 421
- 65 | 18 | 419
- 65 | 21 | 416
- 65 | 24 | 413
- 65 | 27 | 411
- 65 | 30 | 408
- 70 | 15 | 421
- 70 | 18 | 418
- 70 | 21 | 415
- 70 | 24 | 413
- 70 | 27 | 410
- 70 | 30 | 407
- 75 | 15 | 421
- 75 | 18 | 418
- 75 | 21 | 415
- 75 | 24 | 412
- 75 | 27 | 409
- 75 | 30 | 406
Which row? 71 Watney walking time to ship: 456 seconds Lewis walking time to ship: 16 seconds
Do you want 'd' distance mode, 'r' rover mode, or 'q' quit? r What series of angles? 90,180,90,337.5,112.5,157.5,45,0,90,22.5,90,270,90,202.5,112.5,135,90,112.5,67.5,337.5 Mission control on earth sends the following message:
HOW ALIVE?
Do you want 'd' distance mode, 'r' rover mode, or 'q' quit? q Goodbye. May the hexadecimals be with you.