Exemplo n.º 1
0
        static void Main(string[] args)
        {
            string[] commands = File.ReadAllLines(@"C:\Github\AdventOfCode\Day3\cables.txt");

            List <Wire> wires = new List <Wire>();

            foreach (string cmd in commands)
            {
                Wire  wire     = new Wire();
                Line  zero     = new Line(0, wire);
                Point previous = new Point(0, 0, zero);
                wire.AddCoordinate(previous);
                wire.AddLine(zero);

                Increment linecrement = new Increment(0);

                foreach (string action in cmd.Split(","))
                {
                    Line line = new Line(linecrement.Get(), wire);

                    string direction = action[0..1];