Program.cs 744 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Diagnostics;
  2. using Day22;
  3. if (args.Any(a => a == "--debug"))
  4. {
  5. Console.WriteLine("DEBUG");
  6. Console.WriteLine(Debugger.Launch());
  7. }
  8. if (args.Length < 1)
  9. {
  10. Console.WriteLine("Requires 1 args: inputFileName");
  11. return -1;
  12. }
  13. var inputFile = args[0];
  14. var parser = new Parser();
  15. var brickStack = parser.Parse(inputFile);
  16. brickStack.Populate();
  17. brickStack.Print();
  18. Console.WriteLine();
  19. brickStack.Collapse();
  20. brickStack.Print();
  21. Console.WriteLine();
  22. var count = brickStack.CountSafeRemoval();
  23. Console.WriteLine($"Can be disintegrated: {count}");
  24. Console.WriteLine();
  25. var total = brickStack.CountAllFalling();
  26. Console.WriteLine($"Sum of all falling Blocks: {total}");
  27. return 0;