From: Mason Kelsey Date: 2009-09-07T12:11:18+09:00 Subject: Two Dimensional Arrays in Ruby? --001485f628c095ebdc0472f43336 Content-Type: text/plain; charset=ISO-8859-1 No doubt this question has been asked before but I cannot find it and it is not documented in three Ruby books I've checked, which is very strange as two dimensional arrays are a common need in programming. How does one define and use a two dimensional array in Ruby? I tried anarray = [[1, 2, 3], [4, 5, 6] [7, 8, 9]] with puts anarray[1][1] does not deliver the 5 that I would expect but instead, provides (in SciTE) the error message on the line defining the array: >ruby test_2_dimensional_array.rb test_2_dimensional_array.rb:1:in `[]': wrong number of arguments (3 for 2) (ArgumentError) from test_2_dimensional_array.rb:1 >Exit code: 1 So what is the secret for working with two dimensional arrays in Ruby? And is it documented somewhere? Thanks in advance! --001485f628c095ebdc0472f43336--