One possible workaround is to compute your solutions locally. In the code you submit, detect which case are you in, and output the precomputed solution.
As far as I remember, the validators for Mars Lander are not strictly identical to the tests, but very similar (shifted by one unit or something similar), so it should be possible to detect the corresponding case and reuse the solution.
I did this puzzle in each language (except OCaml) and i noticed that the auto-generated code in Scala doesnât work because of the âXâ and âYâ variables name. If you can rename them in Scala i think this puzzle can be perfect. And if you can help me with the OCaml version i will not say no too.
itâs really hard to learn to code from scratch on CodinGame. I recommend taking a tutorial online to learn the basics. Then, youâll be able to tackle the puzzles here.
Episode 1
Input:2500 2500 0 0 500 0 0 (X Y hSpeed vSpeed fuel rotate power)
Output: 0 3 ( rotate power)
Input: 2500 2499 0 -3 499 0 1 (X Y hSpeed vSpeed fuel rotate power)
Output: 0 3 ( rotate power)
I donât get it. If starting power is 0 how do i get 3 power from the first turn and the second turn the power from the input is 1 and in the output its the same. How does that make any sense
The point is that the power is only ever changed by one in a round. So if you print 3 at the beginning as the target force, it takes several moves for the current force to change.
Example:
The default code outputs â0 3â each turn.
When you test it, you realize that itâs not enough, the ship accelerates too much and crashes.
If you output â0 4â each turn, the landing is way too slow and the test fails too.
So you want to balance your outputs between â0 3â and â0 4â.
Try to find a pattern that works.
Hi,
I tried to do some math to solve this puzzle but itâs looks like that when I printf to check some values it doesnât do the math. For exemple :
float delta;
delta = (Y * 2);
printf("|%.2f|", delta);
delta = delta / 3,711;
printf("|%.2f|\n", delta);
With Y = 2500 I have : |5000.00||1666.67|
but 5000 / 3,711 = 1347. 34 and not 1666,67
Did I miss something ?
Is someone able to help me ? I made my code in c++ but it didnât work, so I tried in python but it didnât work too. I went on youtube to understand what was wrong with my code, but it was almost the same. I still copied the code that was on the video I watched, but it didnât work too. Is there someone who encountered the same problem with a correct code that doesnât work ?
seems you managed to pass the puzzle. In this case, please think about updating your post to tell you solved your issue and explaining how. I could help others. Thanks!