advent-of-code/2019/Scala/intcode/opcode/OpCode4.scala
2019-12-09 22:24:54 +01:00

17 lines
400 B
Scala

package intcode.opcode
/** Output
* Outputs the value of its only parameter.
*/
case object OpCode4 extends OpCode
{
/** length of an instruction */
override val length: Int = 2
/** Executes instruction for given parameters and modes */
def output(tape: Array[Long], relative: Long, param1: Long, mode1: Int): Long =
{
accessor(relative, param1, mode1, tape)
}
}