Program.cs 889 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Diagnostics;
  2. using Day24;
  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 isSample = inputFile.Contains("sample");
  15. var parser = new Parser();
  16. var lines = parser.Parse(inputFile).ToList();
  17. var hailStorm = new HailStorm(lines.Select(l => (Line)l).ToList());
  18. var min = isSample ? 7d : 200000000000000d;
  19. var max = isSample ? 27d : 400000000000000d;
  20. var count = hailStorm.Count(min, max);
  21. Console.WriteLine();
  22. Console.WriteLine($"Total: {count}");
  23. Console.WriteLine();
  24. Console.WriteLine("Just put the following code into Python. It's much easier that way.");
  25. Console.WriteLine("-----");
  26. var lucky = new LuckyShot(lines);
  27. lucky.Find();
  28. return 0;