Print bad data
This commit is contained in:
parent
3dfad26d0d
commit
9005e65ebc
1 changed files with 5 additions and 0 deletions
|
@ -36,6 +36,11 @@ until gates.empty?
|
|||
gates.delete(gate)
|
||||
end
|
||||
|
||||
p wires.select { _1.match?(/^x/) }.sort_by(&:first).map { _1.last.to_s }.reverse.join.to_i(2)
|
||||
p wires.select { _1.match?(/^y/) }.sort_by(&:first).map { _1.last.to_s }.reverse.join.to_i(2)
|
||||
x = wires.select { _1.match?(/^x/) }.sort_by(&:first).map { _1.last.to_s }.reverse.join.to_i(2)
|
||||
y = wires.select { _1.match?(/^y/) }.sort_by(&:first).map { _1.last.to_s }.reverse.join.to_i(2)
|
||||
p (x + y)
|
||||
p wires.select { _1.match?(/^z/) }.sort_by(&:first).map { _1.last.to_s }.reverse.join.to_i(2)
|
||||
|
||||
__END__
|
||||
|
|
Loading…
Reference in a new issue