Phrogz wrote: > Mike Keller wrote: >> Alex Young wrote: >>> a.zip(b).map{|c| c.flatten} >> This causes a different problem, what this does is format the output >> like: >> 123 >> 4 > > Actually, it doesn't 'format' the output at all. Let's see what's going > on: > > irb(main):002:0> a = %w{123 456 789 } > => ["123", "456", "789"] That's where the difference comes in - I had irb(main):002:0> a = [[1,2,3]]*4 => [[1,2,3], [1,2,3], [1,2,3], [1,2,3]] > irb(main):003:0> b = %w{x y z} > => ["x", "y", "z"] > irb(main):004:0> a.zip(b) > => [["123", "x"], ["456", "y"], ["789", "z"]] I had => [[[1, 2, 3], 4], [[1, 2, 3], 4], [[1, 2, 3], 4], [[1, 2, 3], 4]] which was why flattening was needed. This is why it's good to see the actual data that's being worked on sometimes... -- Alex