From: Rick DeNatale Date: 2007-05-15T03:39:42+09:00 Subject: Re: Algorithm books for Ruby (was Re: Object-oriented solution to Tower of Hanoi) On 5/13/07, darren kirby wrote: > quoth the Martin DeMello: > > > What would be a nice approach is a tour of the fundamental > > data structures, each one accompanied by an algorithm that it forms > > the core of, and a full implementation in ruby. > > He does include code in Ruby, though oddly, it is not presented inline, nor > even linked inline: > > http://www.brpreiss.com/books/opus8/programs/index.html Not the best examples of ruby code though. For example this: http://www.brpreiss.com/books/opus8/programs/pgm02_01.txt Would be done idiomatically in Ruby as (1..n).inject {|sum, e| sum + e) And this http://www.brpreiss.com/books/opus8/programs/pgm02_04.txt by just a.max A random sampling of the code looks like it's mostly C-code transliterated into Ruby. --- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/