Christopher Date Line
· January 24, 2016
You are the captain of a starship. You have been tasked with finding the 10 closest habitable planets to your home world and colonizing them.
Your home world is located at these coordinates: 22.214.171.124 X & 098.098.11.1 Y & 456.456.99.9 Z
Your coordinate system ranges from 000.000.00.0 to 999.999.99.9
1. Design and code an algorithm to randomly generate 15 000 coordinates. Each of these coordinates must be randomly marked as a planet or a very hungry space monster. (Space monsters eat starships and should be avoided at all costs)
- Each of these coordinates marked as a planet must be randomly marked as habitable or not.
- Each Habitable planet must have a surface area randomly ranging from 1 million to 100 million square kilometers.
- In order to inhabit a planet, you have to colonize more than 50% of it’s surface.
- Colonization takes place at exactly 0.43 seconds per square kilometer.
- Due to the strange construction of the star system you live in, travel time between any planet and its immediate neighbor is always 10 minutes
Write the results to a txt file in a format of your choosing.
2. Design and code an algorithm to read the file created in step 1 which will identify the planets you have to travel to and colonize to achieve the largest amount of colonized space within a 24-hour period.