From: Timothy Hunter Date: 2006-11-15T09:08:47+09:00 Subject: Re: [ARRAYS] Bidimensional Arrays? (opened) Flaab Mrlinux wrote: > Hi there! > > I'm just new at ruby and I have a weird issue probably really dumb but i > just haven't been able to figure it out. > > Using arrays in C or whatever i could define an array using to indexing > numbers, in order to simulate a chess board or whatever... > > board = array[8,8] > > And then store info in that array like this > > board[1,1] = whatever. > > I just can't get that to work in ruby! Why? How can i do it? > > Thx > > The easiest way to define a multidimensional array in Ruby is to define an array of arrays: board = Array.new(8) { Array.new(8) } Run "ri Array.new" to read about how to create and initialize arrays.