From: Dave Dunkin Date: 2001-05-01T12:38:50+09:00 Subject: [ruby-talk:14476] Re: Large Matrix This code works fine for me: matrix = (1..50).map {(1..50).map {"+"}} matrix[2][2] = "a" puts matrix.inspect Dave On Monday, April 30, 2001, at 10:25 PM, rashworth wrote: > The map works fine, but I am not able to redefine > map[2][2] = "a" ? and then print map > > ---------- Original Message ---------------------------------- > From: Dave Thomas > Reply-To: ruby-talk@ruby-lang.org > Date: Tue, 1 May 2001 12:07:48 +0900 > >> "rashworth" writes: >> >>> What is the Ruby code to define a large matrix, 50 by 50 >>> elements with each one equal to "+"? Thank you. ERA >> >> (1..50).map { (1..50).map { '+' } } >> >> > > ---------- Original Message ------------------------ > From: Dave Thomas > Reply-To: ruby-talk@ruby-lang.org > Date: Tue, 1 May 2001 12:07:48 +0900 > > "rashworth" writes: > >> What is the Ruby code to define a large matrix, 50 by 50 >> elements with each one equal to "+"? Thank you. ERA > > (1..50).map { (1..50).map { '+' } } >