From: Hunter Walker Date: 2009-01-23T09:57:11+09:00 Subject: Re: simple ruby program problem Rob Biedenharn wrote: > On Jan 22, 2009, at 6:40 PM, Hunter Walker wrote: > >> while (reply != 'yes' || reply != 'no') > > > Well, this is effectively and infinite loop becasue reply will always > be != to one or the other and the whole expression will be true. > > Since you have a return statement in a couple places, this might not > be a problem for this program. > > -Rob > > Rob Biedenharn http://agileconsultingllc.com > Rob@AgileConsultingLLC.com Yeah, good point. You are right though, the return statement does stop the loop. See attached screen shot for what happens.... Attachments: http://www.ruby-forum.com/attachment/3196/post.jpg -- Posted via http://www.ruby-forum.com/.