From: Ruby Student Date: 2009-03-20T01:05:52+09:00 Subject: Initializing an NxN array --0016e64616780a3d9f04657b0356 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Team, What is the easiest way to initialize a square matrix? For example, to initialize a 3x3 array elements to 0, I am doing what you see below. But I am not sure how to proceed if, for instance, I want a NxN array where N > 10 or a huge value? I played a bit on IRB but could not find the way to do it easily. irb(main):008:0> ary = Array.new(9,[0,0,0]) => [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]] Thank you -- Ruby Student --0016e64616780a3d9f04657b0356--