Hi,

> 1. How do you instantiate multidimensional arrays?
> For single dimensions, I can do:
> a = Array.new
> a[100] = "foo"
> 
> But if I wanted to do 2 dimensions, I currently create a one dimensional 
> array, and if I wanted to enter a new value, I have to check if the row 
> is empty:
> 
> a = Array.new
> if a[200] = nil then
>      a[200] = Array.new
> end
> 
> a[200][200] = "foo"
> 
> Is there a simpler way?
> something like
> a = [][]
> a[300][300] = "goo"
> (which doesn't work...)

for example...

class Array2D < Array
  def [](n)
    self[n]=Array.new if super(n)==nil
    super(n)
  end
end

a = Array2D.new
a[10][10] = "foo"


> 2. Multiline comments?
> Is there a mechanism for it in ruby? ie /* ... */

=begin
  ....
=end

would be a comment.


M.Tanaka