Clean up parse method
This commit is contained in:
parent
4c72a5dbf6
commit
c791500663
1 changed files with 6 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue