| 12345678910111213141516171819202122232425262728293031323334353637 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using static D07._1.Program;
- namespace D07._2
- {
- class Program
- {
- static void Main(string[] args)
- {
- if (args.Length < 1) throw new ArgumentException();
- if (File.Exists(args[0]) == false) throw new FileNotFoundException();
- Signal answerP1 = TestSignalP1(args[0]);
- Signal answer = TestSignalP2(args[0], answerP1);
- Console.WriteLine($"The answer is : {answer.Value}");
- }
- static Signal TestSignalP2(string file, Signal answerP1)
- {
- List<Gate> gates = new List<Gate>();
- ParseFile(file, gates);
- var ga = gates.Where(g => g.R.Name == "a").First();
- var gb = gates.Where(g => g.R.Name == "b").First();
- gb.L1 = answerP1;
- var answer = TestCircuit(gates, ga);
- return answer;
- }
- }
- }
|