Mars Lander - Puzzle discussion


#207

I think level 1 task has a bad condition like the vSpeed must be from 0 to 40. This is wrong. It must from -40 to 0. Also I'v seen many solutions with changing power from 0 to 4 at once. But condition tells that it can change only for +-1 at once. If you print 0 then you need increase to 4 with 4 steps. Or, perhaps I don't understand something.


#208

You can print 4 when your thrust is 0. The simulation will accept it, it'll just raise the thrust by 1 instead of going straight to 4.

You can also have positive vertical speed, it just takes a lot of fuel and doesn't do you any good for this scenario. In Mars lander 2 and 3, it becomes important.


#210

With GO,

Mars Lander - Episode 2

Inputs order of all tests case are differents each other. Can you please fix the problem ?


#211

what do you mean exactly with "Inputs order of all tests case are differents each other." ?


#212
    // hSpeed: the horizontal speed (in m/s), can be negative.
    // vSpeed: the vertical speed (in m/s), can be negative.
    // fuel: the quantity of remaining fuel in liters.
    // rotate: the rotation angle in degrees (-90 to 90).
    // power: the thrust power (0 to 4).

    var X, Y, hSpeed, vSpeed, fuel, rotate, power int    
    fmt.Scan(&rotate, &power, &X, &Y, &hSpeed, &vSpeed, &fuel)
    fmt.Fprintf(os.Stderr, "VARIABLES hspeed: %d power: %d x: %d y: %d rotate: %d vspeed: %d fuel: %d\n", hSpeed, power, X, Y, rotate, vSpeed, fuel)

Depending of test case, the input parameters don't happen in the same order.

Sometimes its hSpeed first (test1), sometimes, it's power first (test2), and so on...

Is it normal ?


#213

I just check again with original code it seems that is my own code that overwrite the input parameters.

So don't take care of my precedent message, i will solve this myself, thanks for your time.


#214

I haven't understood the question.... please anybody elaborate


#215

the Achievement "Economic" at level 1 needs an update. You need to have at least 3000l of fuel and not 300l like it is stated currently


#216

Misuderstanding or bug in Level 1?

It works fine if I check speed not to increase value of -39. But it conflicts with problem set with "<=40" condition. If I use 40, speed of object takes a value of 41 one step after another. :smirk:


#217

It would be a fencepost error. Or, you're not counting the increase in velocity between steps, due to gravity.

Just be lazy and add a fudge factor :slight_smile:


#218

Hi everyone,

As an exercise, I am trying to minimize my fuel consumption on Episode 1. Currently my best solution has 325L fuel left after landing. Could anyone please tell me if this is the maximum amount? An if not, what is the maximum amount?


#219

I myself am not able to get better than 325L.


#220

I advise you to optimize this one instead: https://www.codingame.com/multiplayer/optimization/mars-lander
Much more variety and you can benchmark yourself against the top AIs.


#221

Agreed, but still curious to know whether 325L is the maximum possible.


#222

Did anyone else do it with at least 300l of remaining fuel and not get the achievement


#223

Did you do 300L in test case, or validator (i.e. after you submit your solution and get 100%)? Only validator result counts for the achievement.


#224

Is there a way to exactly calculate the moment when to start using the thrust to land with -40m/s or 0m/s (or as close to 0m/s as possible)? I solved the puzzle but i am not really a fan of the "non-physics" solutions e.g. "if v_speed < XY: ...". Only way i managed was brute forcing (simulating) my way to the exact moment on my local machine - not a really satisfying approach :frowning:


#225

Hello , i' wan't to solve this puzzle with a genetic algorithm but how i can generate generation ? because when the land crash the game it's over


#226

Did you look into this playground?

https://tech.io/playgrounds/334/genetic-algorithms


#228

Yes, I had 309l left