I am learning Ruby and would like to know how I am doing as far as writing the actual code.
Please keep in mind that this is my first Ruby
script program, but I am trying to learn ruby in a very short period of time.
I would like to know about nitpicks in the language that every Ruby writer should now, nuances in syntax, and other Ruby specific ... things.
$randomNumber = rand(10) + 1 def guessRandomNumber puts "Guess a number between 1 and 10" guess = gets if Integer(guess) == $randomNumber puts "Right on, good guess" elsif Integer(guess) < $randomNumber puts "too low" puts "please, guess again" guessRandomNumber elsif Integer(guess) > $randomNumber puts "too high" puts "please, guess again" guessRandomNumber else puts "is that even a number? please, guess again" guessRandomNumber end end guessRandomNumber puts "bye" gets