Looping counter
Looping counter
Create an infinite loop that outputs lines of asterisks, with each line containing one more asterisk. Instead of the asterisk, any printable, non-whitespace character can be used. However all lines need to use the same character.
The beginning of the output looks like this:
*
**
***
****
*****
******
*******
********
*********
**********
***********
************
An ungolfed Python implementation:
from itertools import count
for i in count(1):
print('*'*i)
Lua, 31 bytes ``` =''::::=.. …
4y ago
Vyxal, 5 4 bytes ``` ¤{‹… …
4y ago
[Ruby], 18 bytes lo …
4y ago
MATL, 16 bytes ``` 1`1yh1$ …
4y ago
Haskell, 35 bytes main=mapM …
4y ago
[brainfuck], 31 bytes + …
4y ago
[K (oK)], 9 bytes {x#0} …
2y ago
C, 30 + 1-4 byte f(m){f …
3y ago
Fig, 5 bytes The actual score …
4y ago
Japt, 6 bytes ßOpP±Q …
4y ago
JavaScript, 25 bytes Could …
4y ago
J, 13 char ``` '',^:(<)'' ` …
4y ago
[C (gcc)], 47 bytes …
4y ago
[JavaScript (Node.js)], 31 byt …
4y ago
Embed ESCR, about 32 character …
4y ago
[><>], 10 bytes 1:naoa1 …
4y ago
[dc], 13 bytes [r1+pArd …
4y ago
[Bash], 17 bytes ec …
4y ago
[Python 2], 26 bytes …
4y ago
[Python 3], 28 bytes …
4y ago
[AWK], 26 24 bytes END{ …
2y ago
21 answers
- ← Previous
- 1
- 2
- Next →

2 comment threads