[2016][ruby][18.1]

profile
Alpha Chen 8 years ago
parent 2e1eba56a5
commit f3bd338b7d

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

Loading…
Cancel
Save