From: Rob Biedenharn Date: 2009-01-23T10:13:06+09:00 Subject: Re: simple ruby program problem On Jan 22, 2009, at 7:57 PM, Hunter Walker wrote: > 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 Try running directly from an xterm (Terminal) window. I suspect that running inside TextMate is the cause of the trouble (and that your script wants input). -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com