Okay, just found out that...

@data[x][y] unless y<0 or y>@height

...is the same as stating nil anyway, according to
http://www.themomorohoax.com/2009/05/21/when-to-use-nil-in-ruby-methods

The error I'm getting is...

undefined method `[]=' for nil:NilClass (NoMethodError)

...when the program hits this part of the code...

Array2D[x,y,1] = "X "

-- 
Posted via http://www.ruby-forum.com/.