A question similar to this has been asked a couple of years ago, but this one is even trickier.
The challenge is simple. Write a program (in your language of choice) that repeatedly executes code without using any repetition structures such as
goto (So for all you nitpickers, you can't use a loop). However, recursion is not allowed, in the function calling itself sense (see definition below). That would make this challenge far too easy.
There is no restriction on what needs to be executed in the loop, but post an explanation with your answer so that others can understand exactly what is being implemented.
For those who may be hung up on definitions, the definition of a loop for this question is:
A programming language statement which allows code to be repeatedly executed.
And the definition of recursion for this question will be your standard recursive function definition:
A function that calls itself.
Winner will be the answer that has the most upvotes on July 16th at 10 AM eastern time. Good luck!
To calm confusion that is still being expressed this may help:
Rules as stated above:
- Don't use loops or goto
- Functions cannot call themselves
- Do whatever you want in the 'loop'
If you want to implement something and the rules don't explicitly disallow it, go ahead and do it. Many answers have already bent the rules.