From: Michael Witrant Date: 2001-07-27T03:39:12+09:00 Subject: [ruby-talk:18587] Re: My first Ruby program... :-) On Fri, 27 Jul 2001 02:52:05 +0900, "Bjorn Pettersen" wrote: > Well, it's now two days into playing with Ruby, and I wrote my first > non-trivial program (it's converting a large c++ enum to constants). I'm > still shaky on idiomatic usage, so if any of the initiated would care to > comment on coding style I would be very grateful. > > -- bjorn I only have one comment in mind: > (0...row.length).each {|i| [...] > (0...@maxcols.length).each {|n| Here you can use the Fixnum#times method: row.length.times { |i| @maxcols.length.times { |n| It iterates from 0 to (self-1). But you might like (0...n) better. Mike. midulo.