14 lines
308 B
Crystal
14 lines
308 B
Crystal
require "./intcode.cr"
|
|
lines = File.read("day2.txt").lines.map(&.split(",").map(&.to_i32)).flatten
|
|
100.times do |noun|
|
|
100.times do |verb|
|
|
prog = lines.clone
|
|
prog[1] = noun
|
|
prog[2] = verb
|
|
if run(prog, [] of Int32)[1][0] == 19690720
|
|
puts 100*noun + verb
|
|
break
|
|
end
|
|
end
|
|
end
|