I had the same problem, but it seems that it is 3000 liters and not 300 liters remaining (for level 1, I don’t know for level 2)
I have an problem (C++)
I don’t know why, but after first cycle, data that being given to program is not
X, Y, hSpeed, ySpeed, fuel, rotate, power
but
rotate, power, X, Y, hSpeed, ySpeed, fuel
You are not reading all inputs in the first cycle. More precisely, you read up to “fuel” input. Maybe you did not read all points at startup. Check that your code is modeled after the default code which handles correctly all inputs.
I know it is been so long and I’m new here, while trying to solve this puzzle I have a similar problem too
Because I’m learning from Unity and trying to learn more from this codinggame.so I don’t really know how does console work
In Unity what I’m using is Debug.Log(); while in here Console.WriteLine();
The Difference
Console.WriteLine("Hello, my name is {0}, I'm {1} years old, and I like {2}", name, age, hobby);
While Debug.Log();
Debug.Log("Hello, my name is " + name + " I'm " + age + " years old, and I like " + hobby);
so it’s simple just write it out Console.WriteLine(“0 {0}”, power);
maybe it will help for those who struggle at Console
I think the instructions are unclear, it took me a long time to figure out that if you try to change the power you will fail right away. Instead you only need to change the output. Once you figure that out puzzle 1 is easy.
I do not understand how changing the power could be different from changing the output. The instructions state explicitly you have to output two numbers each turn: the rotation (always 0) and the power (between 0 and 4).
What I mean is that for the longest time I tried to change power to be four as soon as the speed is lower than -30. Instead try to change the output to be “0 4”.
I’ve also come to 2200 meters. BUT, height can change in test vs submit validators, so 2200 equals 0.9 initial height,is when to put thrusters on full.Using this formula if(Y>0.9*initialHeight){thrust 0}else{thrust full} lander always lands with >300l of fuel
i resolve with rest 305l fuel but not give achievement
this is the replay from your submit:
https://www.codingame.com/replay/603394104
You had less than 300L of fuel remaining when landing
The 3rd part is difficult but very interesting. I confirm that it can be done without any IA or simulation, but just some ifs.
Here is my replay : Coding Games and Programming Challenges to Code Better
I did it with more than 600L remaining.
Some advices to do it with more than 400L of fuel remaining :
- use the highest horizontal speed => less time with no vertical speed => less fuel to compensate gravity
- when you go down, don’t be afraid to be close to the max speed for landing (when accelerating down, you use less fuel).
Never mind. I improved some things and had more than 500 remaining and it worked.
I really enjoy that puzzle.
But as a physic noob, I think that it would be nice to add within the puzzle statement how the rounding is done within the game engine/displayed output.
As I’m not confident at all with my physics, I try to compare values with the game output and I find it very hard to understand.
For example, Mars Lander ep2 first test case, initial X & Y = 2500 & 2700:
### Standard Output Stream:
0 0
### Game information:
Landing in progress... X=2500m, Y=2698m,
HSpeed=0m/s VSpeed=-4m/s
Fuel=550l, Angle=0°, Power=0 (0.0m/s2)
With VSpeed=4/ms (actually 3.711ms), why is new Y=2698m? shouldn’t it be 2694 or 2693?
Next turn with 0 0, we get:
Landing in progress...
X=2500m, Y=2693m,
HSpeed=0m/s VSpeed=-7m/s
Fuel=550l, Angle=0°, Power=0 (0.0m/s2)
Now it seems correct.
The solution to Level 1 is definitely as easy as they promise. No math whatsoever, just conditionals. If falling too fast, use thrust, else lower thrust
ok… but how do you turn on the thruster at exact 2115.7m when we get y value snapshot every 1 second interval?
Hi fellows!
From test 8 to 9, why the v_speed changes from -30 m/s to -33m/s with power = 0. Shouldn’t it be -34m/s?
What do you mean by test 8 to 9? Turn 8 to 9?
I think it is easier if you share the replay link (next to the Settings button in the visual player).
Why did you chose “/5,4”?
Hi guys,
If i try to simulate one case, chosing an angle and thrust, i can’t get the exact next speed and position of the lander. There is always a 1-2m diff in x and y, and a 0-1m/s diff in speed.
My calculation are these :
- horizontal speed = initial horizontal speed + sin(rotation) x power
- vertical speed = initial vertical speed + cos (rotation) x power - 3.711
hence x = initial_x + h_speed
and y = initial_y + v_speed
any ideas on my problem ? sorry if it has been dealt with before, This thread is looooooooooong