Update OpCode4.scala

This commit is contained in:
kamoshi 2019-12-09 22:24:54 +01:00 committed by GitHub
parent ce2a2d4805
commit 9723194cb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)
} }