예제 #1
0
 protected override string SolvePartOne()
 {
     IntCodePC.Program[1] = 12;
     IntCodePC.Program[2] = 2;
     foreach (long _ in IntCodePC.RunProgram())
     {
     }
     return(IntCodePC.PreviousRunState[0].ToString());
 }
예제 #2
0
        protected override string SolvePartOne()
        {
            long lastItem = long.MinValue;

            cpu.ReadyInput(1);
            foreach (long item in cpu.RunProgram())
            {
                Console.WriteLine(item);
                lastItem = item;
            }
            return(lastItem.ToString());
        }