Looping counter

From Esolang
Jump to navigation Jump to search

A looping counter counts up to infinity or a specific number (or possibly down to a specific number or negative infinity). Counting from 99 to 0 can be used as a simpler alternative of the 99 bottles of beer program to prove that a language is usable for computation.

The program exhausts unbounded memory over infinite time. It prints each value as it counts, and it exhausts infinite states in infinite time. The program is essentially an unbounded unary counter.


The output of a looping counter is as follows:

*
**
***
****
*****
******
*******
********
*********
**********
***********
************

With each iteration, the memory used grows.

Examples

Two examples are available on the page ///, printing rows of increasingly many asterisks with each run.

The looping counter was also used as the first demonstration that Black was possibly Turing-complete. (Although a looping counter does not prove Turing-completeness in its own right, it helps to demonstrate how a language is capable of storing and retrieving arbitrary amounts of data, which is often one of the hardest aspects of Turing-completeness to discover within a language.)