From: Josh Cheek Date: 2012-09-09T14:07:52+09:00 Subject: Re: "Guess the random number" game --047d7bdc808e9d404504c93dd277 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Sep 7, 2012 at 3:18 AM, Mattias A. wrote: > Hi guys! > > 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. --047d7bdc808e9d404504c93dd277 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, Sep 7, 2012 at 3:18 AM, Mattias A. <lists@ruby-forum.com>= ; wrote:

=A0
Also, use lowercase variable names (by convention, Ru= byists also snake_case them) because variables beginning with capital lette= rs 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.
--047d7bdc808e9d404504c93dd277--