A Vanilla JS Star Wars resupply calculator app determining the needed stops when traveling a given distance.
Open index.html in the browser of choice
- Modern browser
- Swapi API available, check @ https://swapi.dev/api/starships/
Run test() in the browser's console
As part of this code challenge you will be using an API available here: https://swapi.co/
We want to know for all SW star ships, to cover a given distance, how many stops for resupply are required.
The application will take as input a distance in mega lights (MGLT).
The output should be a collection of all the star ships and the total amount of stops required to make the distance between the planets.
All other application details are at your own discretion.
Sample output for 1000000 input:
Y-wing: 74
Millennium Falcon: 9
Rebel Transport: 11