Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in python please This assignment takes us back to the text-based games of the early 1970s, called Lunar Lander (this was one of the first

image text in transcribed
in python please
This assignment takes us back to the text-based games of the early 1970s, called "Lunar Lander" (this was one of the first games I ever played when I was starting out). In this game, you are attempting to land a lunar module (LM) on the moon. At the start of the game, the LM is 1000 meters off the surface of the moon, and it is moving at a velocity of 40 m/sec towards the surface. You have 25 units of fuel remaining. Your goal is to reach the surface (altitude s ) at less than 5 m/sec before running out of fuel. It is OK for the altitude to be less than zero so long as the velocity is below 5 m/sec (a small thump), otherwise it is a Really Bad Day (a big crash). Your program must ask for the amount of fuel to burn for the next second of flight (this is a float that must be greater than or equal to zero). Whatever amount of fuel you enter will modify the altitude and velocity, as well as the fuel remaining. Your "instruments" will then be updated and printed out, and you will be asked for the amount of fuel to burn for the next second. This process repeats until you land, crash, or run out of fuel. If you ask for more fuel to be burned than what you have left, you will burn all remaining fuel. When your fuel tank is empty, the program will no longer ask you for fuel but will continue to update your instruments continuously until you either land or crash. Your velocity will decrease by 4 times the amount of fuel you burn, but will also increase by 2 due to acceleration from the moon's gravity (that is, 2 m/sec for one second increases velocity by 2 m/sec). Your altitude will decrease by the velocity value (velocity is in m/sec but since each step is one second long, the seconds cancel, leaving meters)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

Choose natural conversational words

Answered: 1 week ago