in reply to Loop Abstraction via Recursion

That got me to wondering ... was there some way I could "abstract" a loop construct so that a program could effectively execute a loop some variable number of times?

Algorithm::Loops NestedLoops()


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?