From c791500663e53eae59c75f6fbc7942081be0f812 Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Thu, 5 Dec 2019 23:01:28 -0800 Subject: [PATCH] Clean up parse method --- 2019/day5/intcode.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/2019/day5/intcode.rb b/2019/day5/intcode.rb index f1a72b3..d9114ee 100644 --- a/2019/day5/intcode.rb +++ b/2019/day5/intcode.rb @@ -6,10 +6,12 @@ module Intcode end def self.parse(input) - cleaned = input - .gsub(/^#.*$/, '') - .gsub('\s', '') - Program.new cleaned.split(',').map(&:to_i) + parsed = input + .gsub(/^#.*$/, '') + .gsub('\s', '') + .split(',') + .map(&:to_i) + Program.new parsed end class Memory < Array