Update OpCode4.scala
This commit is contained in:
parent
ce2a2d4805
commit
9723194cb9
|
@ -1,13 +1,15 @@
|
||||||
package intcode.opcode
|
package intcode.opcode
|
||||||
|
|
||||||
/** Output */
|
/** Output
|
||||||
case object OpCode4 extends Output
|
* Outputs the value of its only parameter.
|
||||||
|
*/
|
||||||
|
case object OpCode4 extends OpCode
|
||||||
{
|
{
|
||||||
/** length of an instruction */
|
/** length of an instruction */
|
||||||
override val length: Int = 2
|
override val length: Int = 2
|
||||||
|
|
||||||
/** Executes instruction for given parameters and modes */
|
/** Executes instruction for given parameters and modes */
|
||||||
override def output(tape: Array[Long], relative: Long, param1: Long, mode1: Int): Long =
|
def output(tape: Array[Long], relative: Long, param1: Long, mode1: Int): Long =
|
||||||
{
|
{
|
||||||
accessor(relative, param1, mode1, tape)
|
accessor(relative, param1, mode1, tape)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue