From: Hayden Smith Date: 2008-05-08T20:40:19+09:00 Subject: Re: initial stages of scripting Hi, If I were to pursue this line of logic, how would I allow the break to have two conditions to opperate on? For example, in my first nested loop, I wished to test for the equality of user_answer and correct_answer as well as - this was not included due to my ignorance - a comparison to only continue the loop - regardless whether the two previous were correct - but only whilst looper != 3. Cheers, Hayden ----- Original Message ----- From: "Marc Heiler" Newsgroups: comp.lang.ruby To: "ruby-talk ML" Sent: Thursday, May 08, 2008 8:48 PM Subject: Re: initial stages of scripting >I dont want to go through it all, so just a few hints: > > > puts("What is #{num1} + #{num2}/?") > > > No need for the () here. > Also the / before the ? seems confusing. Maybe omit it. > > The > exit > also seems superfluous. Maybe omit it. > > My favourite loop in ruby is this: > > loop { > # do something here... alter condition, and then finally > break if condition > } > > But maybe you meant to use a while > I personally think "until" is not a good name for use here. > -- > Posted via http://www.ruby-forum.com/. >