|
|
@ -4,8 +4,8 @@ setup = setup
|
|
|
|
.lines(chomp: true)
|
|
|
|
.lines(chomp: true)
|
|
|
|
.map(&:chars)
|
|
|
|
.map(&:chars)
|
|
|
|
.transpose
|
|
|
|
.transpose
|
|
|
|
.select { _1.last =~ /\d/ }
|
|
|
|
.map {|col| col.select { _1 =~ /[A-Z]/ }}
|
|
|
|
.map { _1[0..-2].join.strip.chars }
|
|
|
|
.reject(&:empty?)
|
|
|
|
|
|
|
|
|
|
|
|
moves = moves.scan(/move (\d+) from (\d+) to (\d+)/).map { _1.map(&:to_i) }
|
|
|
|
moves = moves.scan(/move (\d+) from (\d+) to (\d+)/).map { _1.map(&:to_i) }
|
|
|
|
moves.each do |n,from,to|
|
|
|
|
moves.each do |n,from,to|
|
|
|
|