Also, you will want to change || to &&. As it stands, you're checking
that name is either not equal to "bob" or not equal to "fred".
Whatever you put in there, it's going to be not equal to one of them
:)

Logic is tough to grasp at first but stick at it. It'll become clear
if you practice!

On 9 November 2011 14:06, Sam Rose <samwho / lbak.co.uk> wrote:
> Hi James,
>
> You're very close. This code should work:
>
> name =3D gets.chop.downcase
> if name !=3D "bob" || name !=3D "fred"
> =A0puts "That wasn\'t one of the choices."
> else
> =A0code
>
> You have to have a full expression for each part of the conditional.
> What was happening previously was this:
>
> The if statement checked the expression: name !=3D bob
> Then the is statement checked the expression: "fred"
>
> In Ruby, anything that is not nil or false is considered true. Thus
> "fred" is considered true.
>
> I hope this has explained your problem :)
>
> Thanks,
> Sam
>
> On 9 November 2011 14:02, james gallagher <lollyproductions / mac.com> wrot=
e:
>> Hi. =A0I have a stupid question.
>>
>> I'm stuck on the bit of ruby that follows:
>>
>> name =3D gets.chop.downcase
>> if name !=3D "bob" || "fred"
>> =A0puts "That wasn\'t one of the choices."
>> else
>> =A0code
>>
>> If I put "bob" in it says:
>>
>> That wasn't one of the choices.
>>
>> It does the same for anything I put in.
>>
>> Thank you.
>>
>> --
>> Posted via http://www.ruby-forum.com/.
>>
>>
>
>