rashworth spake:
> 
> The map works fine, but I am not able to redefine
> map[2][2] = "a"  ? and then print map

Redefining an element should work.  Are you giving a name to the matrix?
e.g.,

  myMatrix = (1..50).map { (1..50).map { '+' } }

Then myMatrix[2][2] = 'a' would redefine that element of the matrix. 
See, umm, I think you don't want to be calling the matrix 'map'.  You
could, but it sounds potentionally bad for your karma, confusing an
action (map) with the result of that action (the matrix it gives you).

As for printing, I'm not sure what you have in mind.

  -- M

 
> ---------- Original Message ----------------------------------
> From: Dave Thomas <Dave / PragmaticProgrammer.com>
> Reply-To: ruby-talk / ruby-lang.org
> Date: Tue, 1 May 2001 12:07:48 +0900
> 
> >"rashworth" <rashworth / mail.warpnet.net> 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 { '+' }  }