One day in July 2020, I made the following C program:
#define A m]
a[9999],*m=a;main(){for(2[A=4[A=1;;){for(;4[A;putchar(6[m-=3]+48));
for(puts(a);7[A;2[A=4[A,4[A=1)if(4[A+=3[m+=3]-1,9<(3[A=2[A+=3[A))++
5[A,7[A=1,3[A-=10;}}
with three superfluous newlines removed, it's 167 bytes and it prints the fibonacci sequence (as decimal numbers, separated with newline) potentially infinitely (it will crash when exceeding the buffer size after printing many terms of the sequence). Try it online (gcc)! Try it online (clang)!.
As I had trouble golfing it myself, I decided to ask the C golfers of CGCC for help. The challenge is to golf it, or more formally, to produce the same output as this program (and of course you can derive your own solution based on it). The code should stay reasonably portable (i.e. not perform out-of-bounds accesses before program termination is desired, use compiler extensions, etc...).
Your program is expected to print at least 15939
consecutive fibonacci numbers, starting from the smallest, separated with newlines, printed as decimal numbers, starting with 0 1 1 2 3 5 ...
.
Your answer might also provide improvements to the original version as an extra (printing more sequence terms with minimally more bytes, etc... - just make sure to post the golfed version with your answer, because it's the main goal of this question).
[A
trick \$\endgroup\$int v[] = {0, blablabla};
- the 0 will always be the first element of an array:putchar('\n') => putchar(10); => puts(""); => puts(v);
\$\endgroup\$