| 1234567891011121314151617181920212223242526272829303132333435 |
- using System.Diagnostics;
- using Day22;
- 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 brickStack = parser.Parse(inputFile);
- brickStack.Populate();
- brickStack.Print();
- Console.WriteLine();
- brickStack.Collapse();
- brickStack.Print();
- Console.WriteLine();
- var count = brickStack.CountSafeRemoval();
- Console.WriteLine($"Can be disintegrated: {count}");
- Console.WriteLine();
- var total = brickStack.CountAllFalling();
- Console.WriteLine($"Sum of all falling Blocks: {total}");
- return 0;
|