예제 #1
0
    /**
     *
     **/
    static void Main(string[] args)
    {
        string[] inputs;

        // Number of laps.
        inputs = Console.ReadLine().Split(' ');


        // Number of checkpoints.
        inputs = Console.ReadLine().Split(' ');
        int numCheckpoints = int.Parse(inputs[0]);

        //Console.Error.WriteLine("Checkpoints #: "+numCheckpoints);


        // Coordinates for each checkpoint.
        double[][] checkpoints = new double[numCheckpoints][];
        for (int i = 0; i < numCheckpoints; i++)
        {
            inputs         = Console.ReadLine().Split(' ');
            checkpoints[i] = new double[2] {
                double.Parse(inputs[0]), double.Parse(inputs[1])
            };
            //Console.Error.WriteLine("(x,y): "+double.Parse(inputs[0])+", "+double.Parse(inputs[1]));
        }

        // Initialize pods.
        Pod[] pods = new Pod[4];
        for (int i = 0; i < pods.Count(); i++)
        {
            pods[i] = new Pod();
        }


        // game loop
        while (true)
        {
            // Read in new parameters and update pods.
            for (int i = 0; i < 4; i++)
            {
                inputs = Console.ReadLine().Split(' ');
                double cpX = checkpoints[i][0];
                double cpY = checkpoints[i][1];
                pods[i].Update(double.Parse(inputs[0]), double.Parse(inputs[1]), double.Parse(inputs[2]),
                               double.Parse(inputs[3]), double.Parse(inputs[4]), cpX, cpY);
            }

            //Get updated values



            //GAME OUTPUT
            for (int i = 0; i < 2; i++)
            {
                string coords = pods[i].NextCoords();
                string thrust = pods[i].Thrust();
                if (pods[i].Boost())
                {
                    Console.WriteLine(coords + " BOOST");
                }
                else
                {
                    Console.WriteLine(coords + " " + thrust);
                }
            }
        }
    }