I’ve been struggling with the Shuttle exercise for about three days. Before implementing recursion, I tried to solve the problem using a
for loop. The fuel level is reduced, but it doesn’t seem to end properly. With my current setup and fuel level being 200,000, the loop stops at 100,000. But, the fuel status stays green.
I tried it with another fuel level to test. With the fuel level being 100,000, it only iterates once and stops at 90,000. I’ve tried placing the if statement above and below the addition and subtraction of fuel. Also, I tried to change the conditions. For the original fuel level of 200,000, should the remaining fuel level be 100,000 or above 100,000?
If there are sections in the course materials (in Chapter 10 or previous chapters) that address this problem, please let me know.