| 1234567891011121314151617181920212223242526272829303132333435 |
- using System.Diagnostics;
- using Day18;
- if (args.Any(a => a == "--debug"))
- {
- Console.WriteLine("DEBUG");
- Console.WriteLine(Debugger.Launch());
- }
- if (args.Length < 1)
- {
- Console.WriteLine("Requires 1 args: inputFileName");
- return -1;
- }
- var inputFile = args[0];
- var parser = new Parser();
- var instructions = parser.Parse(inputFile).ToList();
- var field = new Field();
- field.Apply(instructions);
- field.Print();
- var volume = field.GetArea();
- Console.WriteLine();
- Console.WriteLine($"Volume: {volume}");
- field = new Field();
- field.Apply(instructions.Select(i => i.Unscramble()).ToList());
- field.Print();
- volume = field.GetArea();
- Console.WriteLine();
- Console.WriteLine($"Volume: {volume}");
- return 0;
|