internal IntCodeOperation( IntCodeOperator oper, IntCodeParamMode paramA = IntCodeParamMode.Position, IntCodeParamMode paramB = IntCodeParamMode.Position, IntCodeParamMode paramC = IntCodeParamMode.Position) : this() { Operator = oper; ParameterA = paramA; ParameterB = paramB; ParameterC = paramC; }
int GetOffset(IntCodeOperator oper) { switch (oper) { case IntCodeOperator.Add: case IntCodeOperator.Multiply: case IntCodeOperator.LessThan: case IntCodeOperator.Equals: return(4); case IntCodeOperator.JumpIfTrue: case IntCodeOperator.JumpIfFalse: return(3); case IntCodeOperator.Input: case IntCodeOperator.Output: case IntCodeOperator.ShiftBase: return(2); default: return(1); } }