Post Reply 
Lunar Lander bug?
06-11-2014, 07:28 AM
Post: #2
RE: Lunar Lander bug?
(06-10-2014 09:02 PM)David Hayden Wrote:  I don't understand lines 69-74. It seems to me that it should subtract v from x also. Am I missing something or is this a bug?

But in some cases that might turn out negative and then you have a problem when taking the square root in line 85. You could change the program that in lines 41-44 you just use the remaining fuel if the entry was bigger than that (no branch to LBL 6), calculate the new values, check whether we crashed and check whether we still have fuel. Only then loop back. Otherwise calculate the final crash velocity. With this approach the redundant calculations after LBL 6 could be avoided.

Cheers
Thomas

PS: The LBL 9 in line 40 could probably be removed.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Lunar Lander bug? - David Hayden - 06-10-2014, 09:02 PM
RE: Lunar Lander bug? - Thomas Klemm - 06-11-2014 07:28 AM



User(s) browsing this thread: 1 Guest(s)