From 33786055b9ff9e2d347652ca2d2aab169b91ef20 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Sat, 7 Dec 2019 20:00:19 -0800 Subject: [PATCH] [2019][ruby] explain the 3 --- 2019/ruby/computer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2019/ruby/computer.rb b/2019/ruby/computer.rb index adb479d..6c5b953 100644 --- a/2019/ruby/computer.rb +++ b/2019/ruby/computer.rb @@ -94,7 +94,7 @@ class Computer opcode = OPCODES.fetch(instruction[-2..-1].to_i) @pc += 1 - n = opcode.arity - 3 + n = opcode.arity - 3 # subtract the memory, input, and output params args = (0...n).map {|i| mode = instruction[2-i] { ?0 } value = @memory.fetch(@pc + i) || 0