Program.cs 678 B

123456789101112131415161718192021222324252627282930
  1. using System.Diagnostics;
  2. using Day20;
  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 processor = parser.Parse(inputFile);
  16. var pulses = processor.Push(1000);
  17. Console.WriteLine();
  18. //Console.WriteLine($"Pulses: {pulses.High} High & {pulses.Low} Low");
  19. Console.WriteLine($"Total: {pulses.High * pulses.Low}");
  20. var count = processor.WaitFor("rx");
  21. Console.WriteLine();
  22. Console.WriteLine($"First 'rx' @ {count}");
  23. return 0;