Update OpCode3.scala

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

View file

@ -1,13 +1,15 @@
package intcode.opcode
/** Input */
case object OpCode3 extends Input
/** Input
* Takes a single integer as input and saves it to the position given by its only parameter.
*/
case object OpCode3 extends OpCode
{
/** length of an instruction */
override val length: Int = 2
/** Executes instruction for given parameters and modes */
override def input(tape: Array[Long], relative: Long, param1: Long, mode1: Int, input: Long): Unit =
def input(tape: Array[Long], relative: Long, param1: Long, mode1: Int, input: Long): Unit =
{
writer(tape, relative, param1, mode1, input)
}