From: Wayne Brissette Date: 2011-12-09T11:20:24+09:00 Subject: Re: What is a good ruby tutorial / book for a beginner? On Dec 8, 2011, at 8:10 PM, Samuel Mensah wrote: > I have been reading Chris Pine's book for a while now and I'm stuck at > the chapter where I have to write my own sorting method. All the code I > tried don't work and when I searched for sorting algorithms and programs > in ruby, ALL the source code I had a look at had a couple of elements in > it that the book I'm reading hasn't taught yet.. Look at these two tutorials: http://www.devdaily.com/blog/post/ruby/ruby-how-sort-array-objects-one-field-column http://www.devdaily.com/blog/post/ruby/how-sort-ruby-array-objects-multiple-class-fields-attributes I learned more from reading these two entries than in any book when it came to sorting. In particular, I fell in love with the multi class field sort. I have been able to do some sorting on data that I could have never done otherwise. Walk through the tutorials, if you have an IDE step through the code and watch the array and values that get put into it and experiment with various sorts. Wayne