From: Matt Mongeau Date: 2013-03-05T04:27:56+09:00 Subject: Re: Can't get If statement right --047d7b603c1c3f9b5204d71e5aac Content-Type: text/plain; charset=ISO-8859-1 You should be getting something like: undefined local variable or method `quit' for main:Object I'd suggest examining that line to see what you've done wrong. Lastly, when you use gets there will be a newline at the end of the input. For example, irb(main):001:0> foo = gets hello => "hello\n" You can use http://www.ruby-doc.org/core-2.0/String.html#method-i-chomp to take care of it. On Mon, Mar 4, 2013 at 2:20 PM, Kat VS wrote: > Okay, thanks! Now it is working. I figured it was thinking they were > integers, and I tried putting quotes around the 1, 2, and 9, but that > still didn't work either. > > But, now, the if statement in the option == 9 elsif section isn't doing > anything? > > And how would I get the program to just loop over and over until the > person quit? > > -- > Posted via http://www.ruby-forum.com/. > > --047d7b603c1c3f9b5204d71e5aac Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
You should be getting something like:

u= ndefined local variable or method `quit' for main:Object I'd sugges= t examining that line to see what you've done wrong.

Lastly, when you use gets there will be a newline at the e= nd of the input. For example,

irb= (main):001:0> foo =3D gets
hello
=3D> "hello= \n"

You can use=A0http://www.ruby-doc.org/core-2.0/Strin= g.html#method-i-chomp to take care of it.


On Mon, Mar 4, 2013 at 2:20 PM, Kat VS <= span dir=3D"ltr"><lists@ruby-forum.com> wrote:
Okay, thanks! Now it is working. I figured it was thinking they were
integers, and I tried putting quotes around the 1, 2, and 9, but that
still didn't work either.

But, now, the if statement in the option =3D=3D 9 elsif section isn't d= oing
anything?

And how would I get the program to just loop over and over until the
person quit?

--047d7b603c1c3f9b5204d71e5aac--