| 1234567891011121314151617181920212223242526272829303132 |
- 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();
- foreach (var i in instructions)
- {
- Console.WriteLine($"{i.Dir}: {i.Num}");
- field.Apply(i);
- }
- field.Print();
- var volume = field.Fill();
- Console.WriteLine();
- Console.WriteLine($"Volume: {volume}");
- return 0;
|