17 lines
243 B
Ruby
17 lines
243 B
Ruby
#!/usr/bin/env ruby
|
|
|
|
require "intcode"
|
|
|
|
intcode = Intcode.for STDIN.read.chomp
|
|
intcode.input.push 1
|
|
intcode.run!
|
|
|
|
puts "Part 1: #{intcode.output.last}"
|
|
|
|
intcode.reset!
|
|
intcode.input.push 5
|
|
intcode.run!
|
|
|
|
puts "Part 2: #{intcode.output.first}"
|
|
|