コード例 #1
0
        public BigInteger GetResult(IntCode intCode)
        {
            if (Mode == Modes.Param)
            {
                return(intCode.GetAddress(Value));
            }

            if (Mode == Modes.Immed)
            {
                return(Value);
            }

            if (Mode == Modes.Rel)
            {
                int newAddress = RelativeBase + (int)Value;
                return(intCode.GetAddress(RelativeBase + Value));
            }

            return(-999);
        }
コード例 #2
0
 public IntCodeProcessor(List <BigInteger> intCode)
 {
     Cursor = 0;
     IntC   = new IntCode(new List <BigInteger>(intCode));
 }