File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -35,18 +35,18 @@ def part1
35
35
while to_be_determined . keys . any? { |wire | wire . start_with? ( 'z' ) } do
36
36
puts to_be_determined . keys . inspect if ENV [ 'DEBUG' ]
37
37
to_be_determined
38
- . select { |wire , gate | gate [ :inputs ] . all? { known_wires . key? ( _1 ) } }
39
- . each do |wire , gate |
40
- known_wires [ wire ] = gate [ :proc ] . call
41
- to_be_determined . delete ( wire )
38
+ . select { |_wire , gate | gate [ :inputs ] . all? { known_wires . key? ( _1 ) } }
39
+ . each do |computable_wire , gate |
40
+ known_wires [ computable_wire ] = gate [ :proc ] . call
41
+ to_be_determined . delete ( computable_wire )
42
42
end
43
43
end
44
44
45
45
known_wires
46
- . select { |wire , signal | wire . start_with? ( 'z' ) }
47
- . sort_by { |wire , signal | wire }
46
+ . select { |wire , _signal | wire . start_with? ( 'z' ) }
47
+ . sort_by { |z_wire , _signal | z_wire }
48
48
. reverse
49
- . map { |wire , signal | signal . to_s }
49
+ . map { |_z_wire_significantly_ordered , signal | signal . to_s }
50
50
. join
51
51
. to_i ( 2 )
52
52
end
You can’t perform that action at this time.
0 commit comments