About this Snippet A typical architecture when looping is to immediately use a boolean to evaluate the next step. See it in action