Beispiel #1
0
 private void buildChain(long input, HashSet <int> phases)
 {
     foreach (var p in phases)
     {
         var output = intCode.Run(p, input)[0];
         if (phases.Count == 1)
         {
             max = Math.Max(max, output);
         }
         else
         {
             var remaining = new HashSet <int>(phases);
             remaining.Remove(p);
             buildChain(output, remaining);
         }
     }
 }
Beispiel #2
0
        public override string Part1(string input)
        {
            var ic = new IntCode(input);

            return(ic.Run(1).describe());
        }
Beispiel #3
0
        string testIC(string input)
        {
            var ic = new IntCode(input);

            return(ic.Run().describe());
        }