Codingame『Puzzle - Mars Lander - Level 1』

f:id:pongeponge:20150112105339j:plain


 適当にやったらできちゃった感。
英語苦手なんで、書くよりも英語を読む方に時間かかった。


 火星に探査機を着陸させるゲーム。
地面に衝突死するのを避けるため、40m/s以下で地面とソフトタッチしないといけない。

using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;

/**
 * Auto-generated code below aims at helping you parse
 * the standard input according to the problem statement.
 **/
class Player
{
    static void Main(string[] args)
    {
        string[] inputs;
        int N = int.Parse(Console.ReadLine()); // the number of points used to draw the surface of Mars.
        for (int i = 0; i < N; i++)
        {
            inputs = Console.ReadLine().Split(' ');
            int LAND_X = int.Parse(inputs[0]); // X coordinate of a surface point. (0 to 6999)
            int LAND_Y = int.Parse(inputs[1]); // Y coordinate of a surface point. By linking all the points together in a sequential fashion, you form the surface of Mars.
        }

        // game loop
        while (true)
        {
            inputs = Console.ReadLine().Split(' ');
            int X = int.Parse(inputs[0]);
            int Y = int.Parse(inputs[1]);
            int HS = int.Parse(inputs[2]); // the horizontal speed (in m/s), can be negative.
            int VS = int.Parse(inputs[3]); // the vertical speed (in m/s), can be negative.
            int F = int.Parse(inputs[4]); // the quantity of remaining fuel in liters.
            int R = int.Parse(inputs[5]); // the rotation angle in degrees (-90 to 90).
            int P = int.Parse(inputs[6]); // the thrust power (0 to 4).

            // Write an action using Console.WriteLine()
            // To debug: Console.Error.WriteLine("Debug messages...");

            if(VS > -40) { //落ちる速度が40m/sより遅ければエンジン停止
            Console.WriteLine("0 0"); // R P. R is the desired rotation angle. P is the desired thrust power.
            }
            else if(VS <= -40) { //落ちる速度が40m/sより早ければ全力点火
                Console.WriteLine("0 4");
            }
            
        }
    }
}


 40m/s以上になったら突然全力を出すONかOFFしか知らないアホエンジンに命を預けた感じ。


Pullip セーラーマーズ (Sailor Mars) P-137

Pullip セーラーマーズ (Sailor Mars) P-137