If you want to repeat until a condition is met, a while loop is probably the best option. You just need to set up a conditional statement that evaluates as false until your statement is true. For example
There is one thing to be careful of. It is possible to create what is called an infinite loop. This occurs when your contidional statement is always false.