- If you want to repeat a calculation for as long as a Boolean
expression's value is
true, then use a whileTrue: expression:
receiver block whileTrue: argument block
- If you want to repeat a calculation for as long as a Boolean
expression's value is
false, then use a whileFalse: expression:
receiver block whileFalse: argument block
- If you want to repeat a calculation for a specified number of times,
then use a
timesRepeat: expression with a block parameter:
integer number of repeats timesRepeat: [statements]
- If you want to repeat a calculation a given number of times
and you want to use a range of integers in the calculation,
then use a
to:do: expression:
lowest integer to: highest integer
do: [:parameter name |statements]