Exemplo n.º 1
0
        public void ReceiveInput(string[] input)
        {
            var robotCommands = new List<string>();

            arena = CreateArena(input[0]);

            for (var i = 1; i < input.Length; i++)
            {
                if (i % 2 == 0)
                {
                    robotCommands.Add(input[i]);
                }
                else
                {
                    var robot = CreateRobot(input[i]);
                    arena.AddRobot(robot);
                }
            }

            var robots = arena.Robots;
            for (var i = 0; i < robots.Count; i++)
            {
                var robot = robots[i];
                var command = robotCommands[i];
                IssueCommand(robot, command);
            }
        }