Patterns for Repetition

Version 0.0001

Alyce Faulstich Brady
Kalamazoo College, Kalamazoo, MI
abrady@kzoo.edu


This document will be a collection of elementary patterns by various authors to use in writing code that requires repeating actions.

The Repetition patterns are:

For/Repeat: Repetition with Well-defined Step
General pattern for repetition with a well-defined step to the next iteration
EXCEPTION: Well-defined step that is equivalent to the initialization (implemented as a while-loop)

Special Cases:

While/Do-while: General Repetition (good name?)
General pattern for repetition

Special Cases:

Recursive Repetition:

Overall Loop Patterns:










Copyright Alyce Faulstich Brady, 1999.