From: Thorsten Haude Date: 2002-04-24T17:29:05+09:00 Subject: My First Time Hi, with your help, I finished my first program in Ruby last weekend. Thanks again! Because Ruby has a lot of qualities that are quite different from other languages, I would like to ask you to have a look over my program and tell me where I break conventions or what else could be done better. It's a fortune clone. - - - Schnipp - - - #! /usr/bin/ruby -w fileName = "/home/yooden/.mail/keywords"; sigDivider = '~###~' sigs = Array.new(1) i = 0 File.open(fileName) { |file| file.each_line { |line| if line =~ sigDivider i += 1 else if sigs[i] == nil sigs[i] = line else sigs[i].concat line end end } } sigs.compact! print sigs[rand(sigs.size)] - - - Schnapp - - - tia, Thorsten -- There is no drug known to man which becomes safer when its production and distribution are handed over to criminals.