|
|
clipka <nomail@nomail> wrote:
> Actually, I remember that when I started programming, I was multiple times
> fooled by the while-loop, about when the condition is checked. The most
> intuitive loop, for me, was:
> REPEAT
> ...
> UNTIL (condition);
> which did exactly what I always expected it to do: Execute the list of
> statements, *then* check for the condition, and if it didn't hold true, repeat
> the whole smash over and over again.
The problem with that is that it will execute the body always at least
once. If it should never be executed (which isn't even a rare occurrence),
you will need to add a conditional around the entire repeat-until loop,
and the condition will be a duplicate of the 'until' condition.
--
- Warp
Post a reply to this message
|
|