I am new to programing and need some help. I have decided to try doing a
“Guess the random number” program. When i try to run below its fails on
keyword_else? But i dont understand why, can some body help me? Thanks
in advance.
print “Guess a number between 0-10\n”
puts “Enter your guess:”
GuessNumber = gets.to_i
Number = rand(10)
If GuessNumber < Number then
puts “Too Loo”
else
puts “Too High”
end
Also, use lowercase variable names (by convention, Rubyists also
snake_case
them) because variables beginning with capital letters are constants,
and
will behave differently. And for your own sanity, you’re going to want
to
indent when you go into the if statements.