Determine the cyclical shift your program is in Write a program that outputs the number 0.

That's a bit trivial, isn't it?

Let the length of your program be \$S\$. Write a program that outputs the number 0. When your program is cyclically shifted \$i &lt; S\$ bytes left, it should output \$i\$. To cyclically shift a string \$i\$ bytes left means to move the last \$i\$ bytes (including newlines) to the front, without changing the order.

For example, if your code is ABCD, then ABCD should output 0; DABC should output 1; CDAB should output 2; BCDA should output 3.

Rules


Your program must be at least 3 bytes long.
"Output" represents any acceptable output: on the stack, to STDOUT, as a return value, as an exit code, etc.
Your program is to not take any form of input.
This is code-golf, so shortest code wins.
brainfuck, 3 bytes

.++


Try it online!

how it works: it's really simple, actually. The internal memory is initialized at 0 so we output (with .) the original cell and we get 0. By shifting the program, we are shifting memory increments (done with +) to before the output, so each byte shifted corresponds to one more increment, and hence we increase the counter.