Exemple #1
0
    public static void Run()
    {
        var map = new Map(
            "###################",
            "###################",
            "###################",
            "###################",
            "###............####",
            "###################",
            "###################",
            "###################",
            "###################",
            "###################");
        var robots = new Robot[]
        {
            new Robot(0, 3, 4, 'R')
        };

        var bestSolution = RandomSolutionFinder.FindSolution(map, robots);
    }
Exemple #2
0
    static void Main(string[] args)
    {
        //Test.Run();

        string[] lines = new string[10];

        for (int i = 0; i < 10; i++)
        {
            string line = Console.ReadLine();
            lines[i] = line;
        }
        Map map = new Map(lines);

        int robotCount = int.Parse(Console.ReadLine());

        Robot[] robots = new Robot[robotCount];

        for (int i = 0; i < robotCount; i++)
        {
            string[] inputs    = Console.ReadLine().Split(' ');
            int      x         = int.Parse(inputs[0]);
            int      y         = int.Parse(inputs[1]);
            string   direction = inputs[2];

            robots[i] = new Robot(i, x, y, direction[0]);
        }

        var bestSolution = RandomSolutionFinder.FindSolution(map, robots);

        // Write an action using Console.WriteLine()
        // To debug: Console.Error.WriteLine("Debug messages...");
        var output = bestSolution.Item1.ToString();

        Player.Debug(output);

        Console.WriteLine(output);
    }