|
|
@ -26,11 +26,12 @@ end
|
|
|
|
|
|
|
|
|
|
|
|
if __FILE__ == $0
|
|
|
|
if __FILE__ == $0
|
|
|
|
row = Row.from_s(DATA.read.chomp)
|
|
|
|
row = Row.from_s(DATA.read.chomp)
|
|
|
|
rows = [row]
|
|
|
|
count = 0
|
|
|
|
while rows.size < 40
|
|
|
|
400_000.times do
|
|
|
|
rows << rows.last.next
|
|
|
|
count += row.tiles.count(:safe)
|
|
|
|
|
|
|
|
row = row.next
|
|
|
|
end
|
|
|
|
end
|
|
|
|
p rows.map {|row| row.tiles.count(:safe) }.inject(:+)
|
|
|
|
p count
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
require 'minitest'
|
|
|
|
require 'minitest'
|
|
|
|