Hi, I realized some realy strange Problem when trying to solve this puzzle (level 1). In the initial step, the X position of the lander was given as 5000 , while the console printed 2500. After the initial step the position was given as delta of the initial position.
Is it supposed to be like this or a bug in the model?
It seems something is wrong with the values read by the program (in C++ at least), I get :
Landing in progress...
X=2500m, Y=2499m, HSpeed=0m/s VSpeed=-3m/s
Fuel=499l, Angle=-5Ā°, Power=1 (1.0m/s2)
Standard Error Stream:
X 0
Y 500
VS 0
HS 0
F 2500
R 2499
P 0
Standard Output Stream:
0 0
3/40
Game information:
Landing in progress...
X=2500m, Y=2494m, HSpeed=0m/s VSpeed=-6m/s
Fuel=499l, Angle=0Ā°, Power=0 (0.0m/s2)
Standard Error Stream:
X -3
Y 499
VS 1
HS -5
F 2500
R 2494
P 0
Standard Output Stream:
5 4
with this code :
cin >> X >> Y >> HS >> VS >> F >> R >> P; cin.ignore();
cerr << "X " << X << endl;
cerr << "Y " << Y << endl;
cerr << "VS " << VS << endl;
cerr << "HS " << HS << endl;
cerr << "F " << F << endl;
cerr << "R " << R << endl;
cerr << "P " << P << endl;
What is your crashing speed? Is it very close to 40m/s?
I used a method very similar to yours. My solution starts to create thrust around 2200m and landed at vertical speed of 39m/s. It is very possible that there is just this discrete vs continuous model that creates enough numerical errors to āslightlyā crash the mars lander.
For the economic challenge as some of you pointed out, the best way is to put the trust to zero to do a freefall, and then calculate the best moment to put them on at full speed (trust power 4).
The NASA successfully achieved this puzzle. You should send them a t-shirt (I donāt know which language they have used, but Iām pretty sure it is not Bash).
while you read the map, store previous Y and then at the next turn check if current Y is the same as the previous Y. If it is the case, then it is the landing area (most propably, if you wanna make sure, try with the next 10 points).
I wonder about landing platform. Thereās everything okay about storing previous Y and checking the current Y, as result, if theyāre the same, weāll get end_X, if i get it right. And what about start_X? How can i store it?
YES! iāve finnaly managed to find measures of landing platform. I didnāt catch the essence from the beginning. I was needed a new pair of variables, which will store previous values of X and Y. Then, within ''if" loop with condition: āis previous Y value equals current Y value?ā, i may set values for start_X, end_X and platform_Y. Itās quite obvious, but i had some kind of smoke in front of my eyes. Feeling myself a little ashamed
But hereās a problem. This code works only when landing platform has only 2 points, given by system. If thereāll be more points - code will store the exact end_X position and position left from it will store as āstart_Xā, but that wonāt be correct. Any ideas how to fix this?
Given points are always the minimal set of points to define the surface so landing platform always has only 2 points. You shouldnāt seek issues where there are none.
I have another thought. In Mars Lander level 3 we have a cliff, which we have to fly over. How can search for it and store, becides of creating arrays? Because my code doesnāt use any arrays. Iām just trying to create a code for every case, though still managing to handle 1st lvl.