Comments on Looping counter
Parent
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 ``` =''::::=.. …
2y ago
Vyxal, 5 4 bytes ``` ¤{‹… …
2y ago
[Ruby], 18 bytes lo …
2y ago
MATL, 16 bytes ``` 1`1yh1$ …
2y ago
Haskell, 35 bytes main=mapM …
2y ago
[brainfuck], 31 bytes + …
2y ago
[K (oK)], 9 bytes {x#0} …
3mo ago
C, 30 + 1-4 byte f(m){f …
1y ago
Fig, 5 bytes The actual score …
2y ago
Japt, 6 bytes ßOpP±Q …
2y ago
JavaScript, 25 bytes Could …
2y ago
J, 13 char ``` '',^:(<)'' ` …
2y ago
[C (gcc)], 47 bytes …
2y ago
[JavaScript (Node.js)], 31 byt …
2y ago
Embed ESCR, about 32 character …
2y ago
[><>], 10 bytes 1:naoa1 …
2y ago
[dc], 13 bytes [r1+pArd …
2y ago
[Bash], 17 bytes ec …
2y ago
[Python 2], 26 bytes …
2y ago
[Python 3], 28 bytes …
2y ago
[AWK], 26 24 bytes END{ …
6mo ago
Post
Haskell, 35 bytes
main=mapM putStrLn$iterate('*':)"*"
55 -> 39, with orthoplex's idea.
39 -> 35 from orthoplex.
2 comment threads