-------------------------------------------------------
Returns a new array. In the first form, the new array is empty. In
the second it is created with _size_ copies of _obj_ (that is,
_size_ references to the same _obj_).
What's wrong with it is that you are using the exact same array for
all 7 spots. You want a new Array to be created for each spot, using
the block notation above.
···
On Sep 23, 8:08 am, Josselin <josse...@wanadoo.fr> wrote:
What's wrong with it is that you are using the exact same array for
all 7 spots. You want a new Array to be created for each spot, using
the block notation above.
On 2007-09-23 16:23:21 +0200, 7stud -- <dolgun@excite.com> said:
Josselin wrote:
what's wrong with my array def ?
--------------------------------------- Array::new
Array.new(size=0, obj=nil)
Array.new(array)
Array.new(size) {|index| block }
-------------------------------------------------------
Returns a new array. In the first form, the new array is empty. In
the second it is created with _size_ copies of _obj_ (that is,
_size_ references to the same _obj_).