From: Chuck Remes Date: 2011-08-22T22:53:55+09:00 Subject: Re: New to Ruby some problems On Aug 22, 2011, at 8:32 AM, jack jones wrote: > I am new to Ruby, My mother tongue is C++ .. I have too many problems I > hope you'd help me with that in the 2 short attached files .. thank you > very much :) > > Attachments: > http://www.ruby-forum.com/attachment/6536/2Dto1D.rb > http://www.ruby-forum.com/attachment/6537/Complex.rb First, fix the syntax errors. You are missing commas in some of your method definitions and adding spaces after the '@' character in your instance variables. There may be other issues, but the Ruby runtime should point them out to you when you try to load and execute your code. To answer your question about adding a setter/getter for the MATRIX class, you could define #[] and #[]= for that purpose to delegate to your @array ivar. e.g. def [](index) @array[index] end def []=(index, value) @array[index] = value end Hope this helps. Welcome to Ruby! cr