On 28.03.2008 00:21, Roger Pack wrote:
> Next wish :)
> I wish that you could make arrays more easily.  As in
> 
> a = [1,2,3]
> a.map{|n| n,n }
> 
> and it would work :)
> -R

You can do

irb(main):002:0> Array.new(3) {|n| [n,n]}
=> [[0, 0], [1, 1], [2, 2]]
irb(main):003:0> (1..3).map {|n| [n,n]}
=> [[1, 1], [2, 2], [3, 3]]

But you don't get rid of the brackets that way.

	robert