Fly the Lander!

After 30 days of staring at rocks and eating cereals you decide it's time to go explore other parts of the planet.

You fly for a while and suddenly realize you're almost out of fuel. Unfortunately you're in a delicate situation and the autopilot is helpless. You will have to pilot the lander yourself. Your mission is to land the lander on a flat zone with a vertical speed less than 10 m/s, an horizontal speed less than 5 m/s and an angle of 0°.

You must define two functions: [!java]void [/!]initialize() and [!java]void [/!]step(). initialize() is called once just after you press "Run". You can use it to chose some flat zone. As before, step() is called every 0.1 second and is used for adjusting the lander's thrust and angle. As in the first exercise the lander's thrust is adjusted via [!java]void [/!]setDesiredThrust([!java]int [/!]desiredThrust[!scala]:Integer[/!]). But you can also control its angle via [!java]void [/!]setDesiredAngle([!java]double [/!]desiredAngle[!scala]:Double[/!]). An angle of 0° denotes a vertical position where the "head" of the lander points up. This is the angle you must land with. A positive angle denotes a left-leaning lander, a negative angle a right-leaning one. You cannot lean more than by ±90°, and the angle can vary by at most ±5° in one step.

As in the previous exercise, [!java]List<Point> [/!]getGround()[!scala]:List[Point][/!] returns the vertices of the ground's profile from left to right. Please refer to the documentation (Help/About this world) for a reference manual of your lunar lander.

As before, your program must safely land the lander in all the situations encountered so far in addition to this new one.

Boa sorte, tente não cair!