From: Stefano Crocco Date: 2012-01-10T21:58:07+09:00 Subject: Re: New to programming, my first program! Il giorno Tue, 10 Jan 2012 21:51:28 +0900 "Luke D." ha scritto: > Hi Ruby world! > > Just thought I'd post my first Ruby program and say hi. > > I'm a classical pianist/vocalist and have to learn Sol-fa as part of my > aural work at UNI. > This is my first stab at making a program of any use to me, quite > exciting! > > If anyone has some suggestions (features, simplify code, bad commenting > etc.) it would be good if I knew now before I delved deeper into the > Ruby world! Just a couple of small improvements: * convert the number of notes to sing to a number before storing it in the how_many variable, rather than doing it every time you use the variable: how_many = gets.chomp.to_i This allows you to remove the .to_i when you use how_many * you don't need to call to_y on the result of rand(7), as it already returns an integer Stefano