public void Part1_QuineSelfReplicating()
            {
                var intcode  = new long[] { 109, 1, 204, -1, 1001, 100, 1, 100, 1008, 100, 16, 101, 1006, 101, 0, 99 };
                var compiler = new IntCodeCompiler();

                compiler.Compute(new IntCodeProgram(intcode.ToArray(), 0));
                IntCodeToBasic.ConvertWhileRunning(intcode.ToArray(), "Day9_Part1_QuineSelfReplicating.txt", false);
                TestUtility.AreEqual(intcode, compiler.OutputValues.ToArray());
            }
            public void Part1()
            {
                var intcode = InputParser.ListOfLongs(Day9Input, ',');

                IntCodeToBasic.ConvertWhileRunning(new IntCodeCompiler(1), new IntCodeProgram(intcode.ToArray(), 0), "D9Part1_HumainCode.txt", false);

                var compiler = new IntCodeCompiler(1);

                compiler.Compute(new IntCodeProgram(intcode, 0));

                Assert.AreEqual(3533056970, compiler.OutputValue);
            }
Exemple #3
0
    public static string Part2(string inputText)
    {
        var intcode = InputParser.ListOfLongs(inputText, ',');

        IntCodeToBasic.ConvertWhileRunning(new IntCodeCompiler(5), new IntCodeProgram(intcode.ToArray(), 0), "D5Part2HumainCode.txt", true);

        var compiler = new IntCodeCompiler(5);

        compiler.Compute(new IntCodeProgram(intcode, 0));

        return(compiler.OutputConcat);
    }