Пример #1
0
        public override string First(string input)
        {
            var alu = new Alu(input);

            alu.ExecuteProgram(haltOnReceive: true);
            return(alu.GetRegValue(_RECEIVE).ToString());
        }
Пример #2
0
        public override string First(string input)
        {
            var alu = new Alu(input);

            alu.ExecuteProgram();
            return(alu.DebugCount["mul"].ToString());
        }
Пример #3
0
        public override string First(string input)
        {
            var alu = new Alu(input);

            alu.ExecuteProgram();
            return(alu.Registers["a"].ToString());
        }
Пример #4
0
        public override string Second(string input)
        {
            // 479009360 : took 29 minutes
            var alu = new Alu(input);

            alu.Registers["a"] = 12;
            alu.ExecuteProgram();
            return(alu.Registers["a"].ToString());
        }
Пример #5
0
        public override string Second(string input)
        {
            //return SecondInCSharp();
            var alu = new Alu(PatchProgram(input));

            alu.Registers["a"] = 1;
            alu.ExecuteProgram();
            return(alu.Registers["h"].ToString());
        }
Пример #6
0
        public override string First(string input)
        {
            var alu = new Alu(input);

            for (int a = 0; a < 100000; a++)
            {
                alu.Reset();
                alu.Registers["a"] = a;
                alu.ExecuteProgram();
                if (alu.Outputs.Count > 0)
                {
                    return(a.ToString());
                }
            }
            return("NOPE");
        }