From: Jacek Podkanski Date: 2003-06-22T09:45:38+09:00 Subject: Re: 2 dimentional array in ruby - niewbie Jacek Podkanski wrote: > Please help > I want to create a multiplication table in ruby. > I want a 2 dimentional array > and the do something like that > > 2darray.new > for row in 1..10 > for col in 1..10 > 2darray[row,col]=row*col > end > end > > How do I do it in Ruby I think I worked out how to do it, but still I don't understand why the 2 outouts are different, and only second is correct. #! /usr/bin/ruby #table acces function def ta(table,row,column,value) r=table[row]; r[column]=value end #### create 2 dimensional array ############# t=Array.new for x in 0..9 row=Array.new for y in 0..9 row[y]=x+1*y+1 end#for t<