Incremental Quine

Javascript - 26 bytes

Defines f() that returns the source code character by character.


Returns undefined after it runs out of characters.

for(i=0;i<30;i++){console.log(f())} //test harness

Jelly, 12 bytes


This is a niladic link. Try it online! (Includes code to call the link twelve times.)

How it works

“;⁾vṾ®ȯ©Ḣ”vṾ  Niladic link.

“;⁾vṾ®ȯ©Ḣ”    Set the left argument and the return value to s =: ';⁾vṾ®ȯ©Ḣ'.
           Ṿ  Uneval; yield r =: '“;⁾vṾ®ȯ©Ḣ”', a string representation of s.
          v   Eval; execute s as a Jelly program with argument r.

 ⁾vV          Yield 'vṾ'.
;             Concatenate r and 'vṾ', yielding q =: '“;⁾vṾ®ȯ©Ḣ”vṾ'.
    ®ȯ        Take the flat logical OR of the register (initially 0) and q.
              This replaces 0 with q in the first run, but it will yield the
              content of the register in subsequent runs.
      ©       Copy the result to the register.
       Ḣ      Head; pop and yield the first character of the register.
              This modifies the string in the register, so it holds one fewer
              character after each call.

As an added bonus, since the register will hold an empty string after the twelveth call, it is once again falsy and the link is ready to start over. Calling the link 24 times will output the source code twice, calling it 36 times thrice, etc.

stacked, noncompeting, 34 bytes

[tostr ':!' + execCounter # out]:!

A variation on the standard quine. This is a full program. This uses execCounter to get how many times this program specifically was run. Errors after outputting everything.

Try it here!