From: "Jan E." Date: 2012-07-17T18:05:52+09:00 Subject: Re: learning by doing part 2 - tc game Sebastjan H. wrote in post #1069017: > well, I like to stay away from until/while, however, I am not sure how > to avoid it in the case of running combat turns: No, "until" and "while" are perfectly fine, I was talking about this particular structure: begin #body end while #condition This one you should avoid, because it behaves unexpectedly (and is just ugly). In contrast to all other uses of the "while" modifier, it executes the body *before* checking the condition -- like a "do-while" loop in other languages. If you actually need a "do-while" loop, use an endless loop with a conditional "break" at the end of the loop body: loop do #body break unless #condition end The same goes for "begin-end-until", of course. In this case you need a "break if" at the end. -- Posted via http://www.ruby-forum.com/.