From: Thufir Date: 2007-11-13T15:10:00+09:00 Subject: Re: alternate to case; generating a list of sub-classes On Nov 8, 10:13 am, Sebastian Hungerecker [...] > Assuming that ArrayOfCreatures.new works like Array.new this can be simplified > to: > creatures = ArrayOfCreatures.new(num_of_creatures) do |i| > creature_classes[rand(4)].new > end It took me a few reads to appreciate, but I like that alot :) -Thufir